diff options
Diffstat (limited to 'src/lib/libcrypto/aes/aes.h')
| -rw-r--r-- | src/lib/libcrypto/aes/aes.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/lib/libcrypto/aes/aes.h b/src/lib/libcrypto/aes/aes.h index 8a3ea0b883..baf0222d49 100644 --- a/src/lib/libcrypto/aes/aes.h +++ b/src/lib/libcrypto/aes/aes.h | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | #ifndef HEADER_AES_H | 52 | #ifndef HEADER_AES_H |
| 53 | #define HEADER_AES_H | 53 | #define HEADER_AES_H |
| 54 | 54 | ||
| 55 | #include <openssl/e_os2.h> | 55 | #include <openssl/opensslconf.h> |
| 56 | 56 | ||
| 57 | #ifdef OPENSSL_NO_AES | 57 | #ifdef OPENSSL_NO_AES |
| 58 | #error AES is disabled. | 58 | #error AES is disabled. |
| @@ -66,17 +66,17 @@ | |||
| 66 | #define AES_MAXNR 14 | 66 | #define AES_MAXNR 14 |
| 67 | #define AES_BLOCK_SIZE 16 | 67 | #define AES_BLOCK_SIZE 16 |
| 68 | 68 | ||
| 69 | #if defined(OPENSSL_FIPS) | ||
| 70 | #define FIPS_AES_SIZE_T int | ||
| 71 | #endif | ||
| 72 | |||
| 73 | #ifdef __cplusplus | 69 | #ifdef __cplusplus |
| 74 | extern "C" { | 70 | extern "C" { |
| 75 | #endif | 71 | #endif |
| 76 | 72 | ||
| 77 | /* This should be a hidden type, but EVP requires that the size be known */ | 73 | /* This should be a hidden type, but EVP requires that the size be known */ |
| 78 | struct aes_key_st { | 74 | struct aes_key_st { |
| 75 | #ifdef AES_LONG | ||
| 79 | unsigned long rd_key[4 *(AES_MAXNR + 1)]; | 76 | unsigned long rd_key[4 *(AES_MAXNR + 1)]; |
| 77 | #else | ||
| 78 | unsigned int rd_key[4 *(AES_MAXNR + 1)]; | ||
| 79 | #endif | ||
| 80 | int rounds; | 80 | int rounds; |
| 81 | }; | 81 | }; |
| 82 | typedef struct aes_key_st AES_KEY; | 82 | typedef struct aes_key_st AES_KEY; |
| @@ -119,6 +119,23 @@ void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, | |||
| 119 | unsigned char ecount_buf[AES_BLOCK_SIZE], | 119 | unsigned char ecount_buf[AES_BLOCK_SIZE], |
| 120 | unsigned int *num); | 120 | unsigned int *num); |
| 121 | 121 | ||
| 122 | /* For IGE, see also http://www.links.org/files/openssl-ige.pdf */ | ||
| 123 | /* NB: the IV is _two_ blocks long */ | ||
| 124 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, | ||
| 125 | const unsigned long length, const AES_KEY *key, | ||
| 126 | unsigned char *ivec, const int enc); | ||
| 127 | /* NB: the IV is _four_ blocks long */ | ||
| 128 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, | ||
| 129 | const unsigned long length, const AES_KEY *key, | ||
| 130 | const AES_KEY *key2, const unsigned char *ivec, | ||
| 131 | const int enc); | ||
| 132 | |||
| 133 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, | ||
| 134 | unsigned char *out, | ||
| 135 | const unsigned char *in, unsigned int inlen); | ||
| 136 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, | ||
| 137 | unsigned char *out, | ||
| 138 | const unsigned char *in, unsigned int inlen); | ||
| 122 | 139 | ||
| 123 | #ifdef __cplusplus | 140 | #ifdef __cplusplus |
| 124 | } | 141 | } |
