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.

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_IDEA_H
  10. #define OPENSSL_IDEA_H
  11. #pragma once
  12. #include <openssl/macros.h>
  13. #ifndef OPENSSL_NO_DEPRECATED_3_0
  14. #define HEADER_IDEA_H
  15. #endif
  16. #include <openssl/opensslconf.h>
  17. #ifndef OPENSSL_NO_IDEA
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. #define IDEA_BLOCK 8
  23. #define IDEA_KEY_LENGTH 16
  24. #ifndef OPENSSL_NO_DEPRECATED_3_0
  25. typedef unsigned int IDEA_INT;
  26. #define IDEA_ENCRYPT 1
  27. #define IDEA_DECRYPT 0
  28. typedef struct idea_key_st
  29. {
  30. IDEA_INT data[9][6];
  31. } IDEA_KEY_SCHEDULE;
  32. #endif
  33. #ifndef OPENSSL_NO_DEPRECATED_3_0
  34. OSSL_DEPRECATEDIN_3_0 const char* IDEA_options(void);
  35. OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char* in, unsigned char* out, IDEA_KEY_SCHEDULE* ks);
  36. OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char* key, IDEA_KEY_SCHEDULE* ks);
  37. OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE* ek, IDEA_KEY_SCHEDULE* dk);
  38. OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char* in, unsigned char* out, long length, IDEA_KEY_SCHEDULE* ks, unsigned char* iv, int enc);
  39. OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char* in, unsigned char* out, long length, IDEA_KEY_SCHEDULE* ks, unsigned char* iv, int* num, int enc);
  40. OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char* in, unsigned char* out, long length, IDEA_KEY_SCHEDULE* ks, unsigned char* iv, int* num);
  41. OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long* in, IDEA_KEY_SCHEDULE* ks);
  42. #endif
  43. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  44. #define idea_options IDEA_options
  45. #define idea_ecb_encrypt IDEA_ecb_encrypt
  46. #define idea_set_encrypt_key IDEA_set_encrypt_key
  47. #define idea_set_decrypt_key IDEA_set_decrypt_key
  48. #define idea_cbc_encrypt IDEA_cbc_encrypt
  49. #define idea_cfb64_encrypt IDEA_cfb64_encrypt
  50. #define idea_ofb64_encrypt IDEA_ofb64_encrypt
  51. #define idea_encrypt IDEA_encrypt
  52. #endif
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif
  57. #endif