diff options
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/aes/aes.cpp | 12 | ||||
-rw-r--r-- | src/block/aes/aes.h | 7 | ||||
-rw-r--r-- | src/block/aes_intel/aes_intel.cpp | 24 | ||||
-rw-r--r-- | src/block/noekeon/noekeon.h | 4 |
4 files changed, 28 insertions, 19 deletions
diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp index 257dfd183..bf9a4198b 100644 --- a/src/block/aes/aes.cpp +++ b/src/block/aes/aes.cpp @@ -409,7 +409,7 @@ const u32bit TD[1024] = { } -/** +/* * AES Encryption */ void AES::encrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -503,7 +503,7 @@ void AES::encrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES Decryption */ void AES::decrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -583,7 +583,7 @@ void AES::decrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES Key Schedule */ void AES::key_schedule(const byte key[], u32bit length) @@ -636,7 +636,7 @@ void AES::key_schedule(const byte key[], u32bit length) DK.copy(XDK, length + 24); } -/** +/* * AES Byte Substitution */ u32bit AES::S(u32bit input) @@ -645,7 +645,7 @@ u32bit AES::S(u32bit input) SE[get_byte(2, input)], SE[get_byte(3, input)]); } -/** +/* * AES Constructor */ AES::AES(u32bit key_size) : BlockCipher(16, key_size) @@ -655,7 +655,7 @@ AES::AES(u32bit key_size) : BlockCipher(16, key_size) ROUNDS = (key_size / 4) + 6; } -/** +/* * Clear memory of sensitive data */ void AES::clear() diff --git a/src/block/aes/aes.h b/src/block/aes/aes.h index 00b3163b7..8770bdb35 100644 --- a/src/block/aes/aes.h +++ b/src/block/aes/aes.h @@ -26,7 +26,12 @@ class BOTAN_DLL AES : public BlockCipher BlockCipher* clone() const { return new AES; } AES() : BlockCipher(16, 16, 32, 8) { ROUNDS = 14; } - AES(u32bit); + + /** + * AES fixed to a particular key_size (16, 24, or 32 bytes) + * @param key_size the chosen fixed key size + */ + AES(u32bit key_size); private: void key_schedule(const byte[], u32bit); static u32bit S(u32bit); diff --git a/src/block/aes_intel/aes_intel.cpp b/src/block/aes_intel/aes_intel.cpp index 0da523156..211bb3b47 100644 --- a/src/block/aes_intel/aes_intel.cpp +++ b/src/block/aes_intel/aes_intel.cpp @@ -100,7 +100,7 @@ __m128i aes_256_key_expansion(__m128i key, __m128i key2) B3 = _mm_aesdeclast_si128(B3, K); \ } while(0) -/** +/* * AES-128 Encryption */ void AES_128_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -176,7 +176,7 @@ void AES_128_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES-128 Decryption */ void AES_128_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -252,7 +252,7 @@ void AES_128_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES-128 Key Schedule */ void AES_128_Intel::key_schedule(const byte key[], u32bit) @@ -301,7 +301,7 @@ void AES_128_Intel::key_schedule(const byte key[], u32bit) _mm_storeu_si128(DK_mm + 10, K0); } -/** +/* * Clear memory of sensitive data */ void AES_128_Intel::clear() @@ -310,7 +310,7 @@ void AES_128_Intel::clear() DK.clear(); } -/** +/* * AES-192 Encryption */ void AES_192_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -392,7 +392,7 @@ void AES_192_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES-192 Decryption */ void AES_192_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -474,7 +474,7 @@ void AES_192_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES-192 Key Schedule */ void AES_192_Intel::key_schedule(const byte key[], u32bit) @@ -517,7 +517,7 @@ void AES_192_Intel::key_schedule(const byte key[], u32bit) _mm_storeu_si128(DK_mm + 12, EK_mm[0]); } -/** +/* * Clear memory of sensitive data */ void AES_192_Intel::clear() @@ -526,7 +526,7 @@ void AES_192_Intel::clear() DK.clear(); } -/** +/* * AES-256 Encryption */ void AES_256_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -614,7 +614,7 @@ void AES_256_Intel::encrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES-256 Decryption */ void AES_256_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const @@ -702,7 +702,7 @@ void AES_256_Intel::decrypt_n(const byte in[], byte out[], u32bit blocks) const } } -/** +/* * AES-256 Key Schedule */ void AES_256_Intel::key_schedule(const byte key[], u32bit) @@ -767,7 +767,7 @@ void AES_256_Intel::key_schedule(const byte key[], u32bit) _mm_storeu_si128(DK_mm + 14, K0); } -/** +/* * Clear memory of sensitive data */ void AES_256_Intel::clear() diff --git a/src/block/noekeon/noekeon.h b/src/block/noekeon/noekeon.h index f1175f529..018c1d1fd 100644 --- a/src/block/noekeon/noekeon.h +++ b/src/block/noekeon/noekeon.h @@ -29,6 +29,10 @@ class BOTAN_DLL Noekeon : public BlockCipher private: void key_schedule(const byte[], u32bit); protected: // for access by SIMD subclass + + /** + * The Noekeon round constants + */ static const byte RC[17]; SecureVector<u32bit, 4> EK, DK; |