idea.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #endif
  21. #define IDEA_BLOCK 8
  22. #define IDEA_KEY_LENGTH 16
  23. #ifndef OPENSSL_NO_DEPRECATED_3_0
  24. typedef unsigned int IDEA_INT;
  25. #define IDEA_ENCRYPT 1
  26. #define IDEA_DECRYPT 0
  27. typedef struct idea_key_st {
  28. IDEA_INT data[9][6];
  29. } IDEA_KEY_SCHEDULE;
  30. #endif
  31. #ifndef OPENSSL_NO_DEPRECATED_3_0
  32. OSSL_DEPRECATEDIN_3_0 const char *IDEA_options(void);
  33. OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char *in,
  34. unsigned char *out,
  35. IDEA_KEY_SCHEDULE *ks);
  36. OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char *key,
  37. IDEA_KEY_SCHEDULE *ks);
  38. OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek,
  39. IDEA_KEY_SCHEDULE *dk);
  40. OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char *in,
  41. unsigned char *out, long length,
  42. IDEA_KEY_SCHEDULE *ks,
  43. unsigned char *iv, int enc);
  44. OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char *in,
  45. unsigned char *out, long length,
  46. IDEA_KEY_SCHEDULE *ks,
  47. unsigned char *iv, int *num,
  48. int enc);
  49. OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char *in,
  50. unsigned char *out, long length,
  51. IDEA_KEY_SCHEDULE *ks,
  52. unsigned char *iv, int *num);
  53. OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long *in,
  54. IDEA_KEY_SCHEDULE *ks);
  55. #endif
  56. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  57. #define idea_options IDEA_options
  58. #define idea_ecb_encrypt IDEA_ecb_encrypt
  59. #define idea_set_encrypt_key IDEA_set_encrypt_key
  60. #define idea_set_decrypt_key IDEA_set_decrypt_key
  61. #define idea_cbc_encrypt IDEA_cbc_encrypt
  62. #define idea_cfb64_encrypt IDEA_cfb64_encrypt
  63. #define idea_ofb64_encrypt IDEA_ofb64_encrypt
  64. #define idea_encrypt IDEA_encrypt
  65. #endif
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif
  70. #endif