rc2.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #endif
  21. #define RC2_BLOCK 8
  22. #define RC2_KEY_LENGTH 16
  23. #ifndef OPENSSL_NO_DEPRECATED_3_0
  24. typedef unsigned int RC2_INT;
  25. #define RC2_ENCRYPT 1
  26. #define RC2_DECRYPT 0
  27. typedef struct rc2_key_st {
  28. RC2_INT data[64];
  29. } RC2_KEY;
  30. #endif
  31. #ifndef OPENSSL_NO_DEPRECATED_3_0
  32. OSSL_DEPRECATEDIN_3_0 void RC2_set_key(RC2_KEY *key, int len,
  33. const unsigned char *data, int bits);
  34. OSSL_DEPRECATEDIN_3_0 void RC2_ecb_encrypt(const unsigned char *in,
  35. unsigned char *out, RC2_KEY *key,
  36. int enc);
  37. OSSL_DEPRECATEDIN_3_0 void RC2_encrypt(unsigned long *data, RC2_KEY *key);
  38. OSSL_DEPRECATEDIN_3_0 void RC2_decrypt(unsigned long *data, RC2_KEY *key);
  39. OSSL_DEPRECATEDIN_3_0 void RC2_cbc_encrypt(const unsigned char *in,
  40. unsigned char *out, long length,
  41. RC2_KEY *ks, unsigned char *iv,
  42. int enc);
  43. OSSL_DEPRECATEDIN_3_0 void RC2_cfb64_encrypt(const unsigned char *in,
  44. unsigned char *out, long length,
  45. RC2_KEY *schedule,
  46. unsigned char *ivec,
  47. int *num, int enc);
  48. OSSL_DEPRECATEDIN_3_0 void RC2_ofb64_encrypt(const unsigned char *in,
  49. unsigned char *out, long length,
  50. RC2_KEY *schedule,
  51. unsigned char *ivec,
  52. int *num);
  53. #endif
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif
  58. #endif