You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef OPENSSL_RC2_H
  10. #define OPENSSL_RC2_H
  11. #pragma once
  12. #include <openssl/macros.h>
  13. #ifndef OPENSSL_NO_DEPRECATED_3_0
  14. #define HEADER_RC2_H
  15. #endif
  16. #include <openssl/opensslconf.h>
  17. #ifndef OPENSSL_NO_RC2
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. #define RC2_BLOCK 8
  23. #define RC2_KEY_LENGTH 16
  24. #ifndef OPENSSL_NO_DEPRECATED_3_0
  25. typedef unsigned int RC2_INT;
  26. #define RC2_ENCRYPT 1
  27. #define RC2_DECRYPT 0
  28. typedef struct rc2_key_st
  29. {
  30. RC2_INT data[64];
  31. } RC2_KEY;
  32. #endif
  33. #ifndef OPENSSL_NO_DEPRECATED_3_0
  34. OSSL_DEPRECATEDIN_3_0 void RC2_set_key(RC2_KEY* key, int len, const unsigned char* data, int bits);
  35. OSSL_DEPRECATEDIN_3_0 void RC2_ecb_encrypt(const unsigned char* in, unsigned char* out, RC2_KEY* key, int enc);
  36. OSSL_DEPRECATEDIN_3_0 void RC2_encrypt(unsigned long* data, RC2_KEY* key);
  37. OSSL_DEPRECATEDIN_3_0 void RC2_decrypt(unsigned long* data, RC2_KEY* key);
  38. OSSL_DEPRECATEDIN_3_0 void RC2_cbc_encrypt(const unsigned char* in, unsigned char* out, long length, RC2_KEY* ks, unsigned char* iv, int enc);
  39. OSSL_DEPRECATEDIN_3_0 void RC2_cfb64_encrypt(const unsigned char* in, unsigned char* out, long length, RC2_KEY* schedule, unsigned char* ivec, int* num, int enc);
  40. OSSL_DEPRECATEDIN_3_0 void RC2_ofb64_encrypt(const unsigned char* in, unsigned char* out, long length, RC2_KEY* schedule, unsigned char* ivec, int* num);
  41. #endif
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif
  46. #endif