diff options
Diffstat (limited to 'openssl/crypto/seed')
-rw-r--r-- | openssl/crypto/seed/seed.c | 13 | ||||
-rw-r--r-- | openssl/crypto/seed/seed.h | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/openssl/crypto/seed/seed.c b/openssl/crypto/seed/seed.c index 2bc384a19..3e675a8d7 100644 --- a/openssl/crypto/seed/seed.c +++ b/openssl/crypto/seed/seed.c @@ -32,9 +32,14 @@ #include <memory.h> #endif +#include <openssl/crypto.h> #include <openssl/seed.h> #include "seed_locl.h" +#ifdef SS /* can get defined on Solaris by inclusion of <stdlib.h> */ +#undef SS +#endif + static const seed_word SS[4][256] = { { 0x2989a1a8, 0x05858184, 0x16c6d2d4, 0x13c3d3d0, 0x14445054, 0x1d0d111c, 0x2c8ca0ac, 0x25052124, 0x1d4d515c, 0x03434340, 0x18081018, 0x1e0e121c, 0x11415150, 0x3cccf0fc, 0x0acac2c8, 0x23436360, @@ -192,8 +197,14 @@ static const seed_word KC[] = { KC0, KC1, KC2, KC3, KC4, KC5, KC6, KC7, KC8, KC9, KC10, KC11, KC12, KC13, KC14, KC15 }; #endif - void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks) +#ifdef OPENSSL_FIPS + { + fips_cipher_abort(SEED); + private_SEED_set_key(rawkey, ks); + } +void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks) +#endif { seed_word x1, x2, x3, x4; seed_word t0, t1; diff --git a/openssl/crypto/seed/seed.h b/openssl/crypto/seed/seed.h index 6ffa5f024..c50fdd360 100644 --- a/openssl/crypto/seed/seed.h +++ b/openssl/crypto/seed/seed.h @@ -116,7 +116,9 @@ typedef struct seed_key_st { #endif } SEED_KEY_SCHEDULE; - +#ifdef OPENSSL_FIPS +void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks); +#endif void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks); void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], const SEED_KEY_SCHEDULE *ks); |