gnunet-android

GNUnet for Android
Log | Files | Refs | README

rc4.h (1837B)


      1 /* rc4.h
      2  *
      3  * Copyright (C) 2006-2025 wolfSSL Inc.
      4  *
      5  * This file is part of wolfSSL.
      6  *
      7  * wolfSSL is free software; you can redistribute it and/or modify
      8  * it under the terms of the GNU General Public License as published by
      9  * the Free Software Foundation; either version 3 of the License, or
     10  * (at your option) any later version.
     11  *
     12  * wolfSSL is distributed in the hope that it will be useful,
     13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15  * GNU General Public License for more details.
     16  *
     17  * You should have received a copy of the GNU General Public License
     18  * along with this program; if not, write to the Free Software
     19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
     20  */
     21 
     22 
     23 
     24 /*  rc4.h defines mini des openssl compatibility layer
     25  *
     26  */
     27 
     28 #ifndef WOLFSSL_RC4_COMPAT_H_
     29 #define WOLFSSL_RC4_COMPAT_H_
     30 
     31 #include <wolfssl/wolfcrypt/settings.h>
     32 #include <wolfssl/openssl/ssl.h> /* included for size_t */
     33 
     34 #ifdef __cplusplus
     35     extern "C" {
     36 #endif
     37 
     38 /* applications including wolfssl/openssl/rc4.h are expecting to have access to
     39  * the size of RC4_KEY structures. */
     40 typedef struct WOLFSSL_RC4_KEY {
     41     /* big enough for Arc4 from wolfssl/wolfcrypt/arc4.h */
     42     void* holder[(272 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
     43 } WOLFSSL_RC4_KEY;
     44 
     45 WOLFSSL_API void wolfSSL_RC4_set_key(WOLFSSL_RC4_KEY* key, int len,
     46         const unsigned char* data);
     47 WOLFSSL_API void wolfSSL_RC4(WOLFSSL_RC4_KEY* key, size_t len,
     48         const unsigned char* in, unsigned char* out);
     49 
     50 #ifndef OPENSSL_COEXIST
     51 
     52 typedef WOLFSSL_RC4_KEY RC4_KEY;
     53 
     54 #define RC4         wolfSSL_RC4
     55 #define RC4_set_key wolfSSL_RC4_set_key
     56 
     57 #endif /* !OPENSSL_COEXIST */
     58 
     59 #ifdef __cplusplus
     60     }  /* extern "C" */
     61 #endif
     62 
     63 #endif /* WOLFSSL_RC4_COMPAT_H_ */
     64