Loading apps/speed.c +4 −0 Original line number Diff line number Diff line Loading @@ -190,7 +190,11 @@ #define idea_set_encrypt_key private_idea_set_encrypt_key #define SEED_set_key private_SEED_set_key #define RC2_set_key private_RC2_set_key #define RC4_set_key private_RC4_set_key #define DES_set_key_unchecked private_DES_set_key_unchecked #define AES_set_encrypt_key private_AES_set_encrypt_key #define AES_set_decrypt_key private_AES_set_decrypt_key #define Camellia_set_key private_Camellia_set_key #endif #ifndef HAVE_FORK Loading crypto/aes/aes.h +5 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void AES_decrypt(const unsigned char *in, unsigned char *out, Loading crypto/aes/aes_core.c +2 −2 Original line number Diff line number Diff line Loading @@ -625,7 +625,7 @@ static const u32 rcon[] = { /** * Expand the cipher key into the encryption key schedule. */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { u32 *rk; Loading Loading @@ -726,7 +726,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, /** * Expand the cipher key into the decryption key schedule. */ int AES_set_decrypt_key(const unsigned char *userKey, const int bits, int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { u32 *rk; Loading crypto/aes/aes_misc.c +21 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ */ #include <openssl/opensslv.h> #include <openssl/crypto.h> #include <openssl/aes.h> #include "aes_locl.h" Loading @@ -62,3 +63,23 @@ const char *AES_options(void) { return "aes(partial)"; #endif } /* FIPS wrapper functions to block low level AES calls in FIPS mode */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { #ifdef OPENSSL_FIPS fips_cipher_abort(AES); #endif return private_AES_set_encrypt_key(userKey, bits, key); } int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { #ifdef OPENSSL_FIPS fips_cipher_abort(AES); #endif return private_AES_set_decrypt_key(userKey, bits, key); } crypto/aes/asm/aes-586.pl +7 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ # but exhibits up to 10% improvement on other cores. # # Second version is "monolithic" replacement for aes_core.c, which in # addition to AES_[de|en]crypt implements AES_set_[de|en]cryption_key. # addition to AES_[de|en]crypt implements private_AES_set_[de|en]cryption_key. # This made it possible to implement little-endian variant of the # algorithm without modifying the base C code. Motivating factor for # the undertaken effort was that it appeared that in tight IA-32 Loading Loading @@ -2854,12 +2854,12 @@ sub enckey() &set_label("exit"); &function_end("_x86_AES_set_encrypt_key"); # int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &function_begin_B("AES_set_encrypt_key"); &function_begin_B("private_AES_set_encrypt_key"); &call ("_x86_AES_set_encrypt_key"); &ret (); &function_end_B("AES_set_encrypt_key"); &function_end_B("private_AES_set_encrypt_key"); sub deckey() { my ($i,$key,$tp1,$tp2,$tp4,$tp8) = @_; Loading Loading @@ -2916,9 +2916,9 @@ sub deckey() &mov (&DWP(4*$i,$key),$tp1); } # int AES_set_decrypt_key(const unsigned char *userKey, const int bits, # int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &function_begin_B("AES_set_decrypt_key"); &function_begin_B("private_AES_set_decrypt_key"); &call ("_x86_AES_set_encrypt_key"); &cmp ("eax",0); &je (&label("proceed")); Loading Loading @@ -2974,7 +2974,7 @@ sub deckey() &jb (&label("permute")); &xor ("eax","eax"); # return success &function_end("AES_set_decrypt_key"); &function_end("private_AES_set_decrypt_key"); &asciz("AES for x86, CRYPTOGAMS by <appro\@openssl.org>"); &asm_finish(); Loading
apps/speed.c +4 −0 Original line number Diff line number Diff line Loading @@ -190,7 +190,11 @@ #define idea_set_encrypt_key private_idea_set_encrypt_key #define SEED_set_key private_SEED_set_key #define RC2_set_key private_RC2_set_key #define RC4_set_key private_RC4_set_key #define DES_set_key_unchecked private_DES_set_key_unchecked #define AES_set_encrypt_key private_AES_set_encrypt_key #define AES_set_decrypt_key private_AES_set_decrypt_key #define Camellia_set_key private_Camellia_set_key #endif #ifndef HAVE_FORK Loading
crypto/aes/aes.h +5 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void AES_decrypt(const unsigned char *in, unsigned char *out, Loading
crypto/aes/aes_core.c +2 −2 Original line number Diff line number Diff line Loading @@ -625,7 +625,7 @@ static const u32 rcon[] = { /** * Expand the cipher key into the encryption key schedule. */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { u32 *rk; Loading Loading @@ -726,7 +726,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, /** * Expand the cipher key into the decryption key schedule. */ int AES_set_decrypt_key(const unsigned char *userKey, const int bits, int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { u32 *rk; Loading
crypto/aes/aes_misc.c +21 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ */ #include <openssl/opensslv.h> #include <openssl/crypto.h> #include <openssl/aes.h> #include "aes_locl.h" Loading @@ -62,3 +63,23 @@ const char *AES_options(void) { return "aes(partial)"; #endif } /* FIPS wrapper functions to block low level AES calls in FIPS mode */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { #ifdef OPENSSL_FIPS fips_cipher_abort(AES); #endif return private_AES_set_encrypt_key(userKey, bits, key); } int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key) { #ifdef OPENSSL_FIPS fips_cipher_abort(AES); #endif return private_AES_set_decrypt_key(userKey, bits, key); }
crypto/aes/asm/aes-586.pl +7 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ # but exhibits up to 10% improvement on other cores. # # Second version is "monolithic" replacement for aes_core.c, which in # addition to AES_[de|en]crypt implements AES_set_[de|en]cryption_key. # addition to AES_[de|en]crypt implements private_AES_set_[de|en]cryption_key. # This made it possible to implement little-endian variant of the # algorithm without modifying the base C code. Motivating factor for # the undertaken effort was that it appeared that in tight IA-32 Loading Loading @@ -2854,12 +2854,12 @@ sub enckey() &set_label("exit"); &function_end("_x86_AES_set_encrypt_key"); # int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &function_begin_B("AES_set_encrypt_key"); &function_begin_B("private_AES_set_encrypt_key"); &call ("_x86_AES_set_encrypt_key"); &ret (); &function_end_B("AES_set_encrypt_key"); &function_end_B("private_AES_set_encrypt_key"); sub deckey() { my ($i,$key,$tp1,$tp2,$tp4,$tp8) = @_; Loading Loading @@ -2916,9 +2916,9 @@ sub deckey() &mov (&DWP(4*$i,$key),$tp1); } # int AES_set_decrypt_key(const unsigned char *userKey, const int bits, # int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &function_begin_B("AES_set_decrypt_key"); &function_begin_B("private_AES_set_decrypt_key"); &call ("_x86_AES_set_encrypt_key"); &cmp ("eax",0); &je (&label("proceed")); Loading Loading @@ -2974,7 +2974,7 @@ sub deckey() &jb (&label("permute")); &xor ("eax","eax"); # return success &function_end("AES_set_decrypt_key"); &function_end("private_AES_set_decrypt_key"); &asciz("AES for x86, CRYPTOGAMS by <appro\@openssl.org>"); &asm_finish();