rc4.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* rc4.h
  2. *
  3. * Copyright (C) 2006-2023 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 2 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. /* rc4.h defines mini des openssl compatibility layer
  22. *
  23. */
  24. #ifndef WOLFSSL_RC4_COMPAT_H_
  25. #define WOLFSSL_RC4_COMPAT_H_
  26. #include <wolfssl/wolfcrypt/settings.h>
  27. #include <wolfssl/openssl/ssl.h> /* included for size_t */
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* applications including wolfssl/openssl/rc4.h are expecting to have access to
  32. * the size of RC4_KEY structures. */
  33. typedef struct WOLFSSL_RC4_KEY {
  34. /* big enough for Arc4 from wolfssl/wolfcrypt/arc4.h */
  35. void* holder[(272 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
  36. } WOLFSSL_RC4_KEY;
  37. typedef WOLFSSL_RC4_KEY RC4_KEY;
  38. WOLFSSL_API void wolfSSL_RC4_set_key(WOLFSSL_RC4_KEY* key, int len,
  39. const unsigned char* data);
  40. WOLFSSL_API void wolfSSL_RC4(WOLFSSL_RC4_KEY* key, size_t len,
  41. const unsigned char* in, unsigned char* out);
  42. #define RC4 wolfSSL_RC4
  43. #define RC4_set_key wolfSSL_RC4_set_key
  44. #ifdef __cplusplus
  45. } /* extern "C" */
  46. #endif
  47. #endif /* WOLFSSL_RC4_COMPAT_H_ */