diff options
Diffstat (limited to 'src')
73 files changed, 81 insertions, 81 deletions
diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp index 24f1f6213..5e934a9f1 100644 --- a/src/block/aes/aes.cpp +++ b/src/block/aes/aes.cpp @@ -123,7 +123,7 @@ void AES::dec(const byte in[], byte out[]) const /************************************************* * AES Key Schedule * *************************************************/ -void AES::key(const byte key[], u32bit length) +void AES::key_schedule(const byte key[], u32bit length) { static const u32bit RC[10] = { 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, diff --git a/src/block/aes/aes.h b/src/block/aes/aes.h index e287a303d..28728a666 100644 --- a/src/block/aes/aes.h +++ b/src/block/aes/aes.h @@ -24,7 +24,7 @@ class BOTAN_DLL AES : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static u32bit S(u32bit); static const byte SE[256]; diff --git a/src/block/blowfish/blowfish.cpp b/src/block/blowfish/blowfish.cpp index ffca9241f..f55cffb62 100644 --- a/src/block/blowfish/blowfish.cpp +++ b/src/block/blowfish/blowfish.cpp @@ -69,7 +69,7 @@ void Blowfish::dec(const byte in[], byte out[]) const /************************************************* * Blowfish Key Schedule * *************************************************/ -void Blowfish::key(const byte key[], u32bit length) +void Blowfish::key_schedule(const byte key[], u32bit length) { clear(); diff --git a/src/block/blowfish/blowfish.h b/src/block/blowfish/blowfish.h index 16f5239e3..c4ef16683 100644 --- a/src/block/blowfish/blowfish.h +++ b/src/block/blowfish/blowfish.h @@ -23,7 +23,7 @@ class BOTAN_DLL Blowfish : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); void generate_sbox(u32bit[], u32bit, u32bit&, u32bit&) const; static const u32bit P_INIT[18]; diff --git a/src/block/cast/cast128.cpp b/src/block/cast/cast128.cpp index 14e5c9e9d..6a6b46efd 100644 --- a/src/block/cast/cast128.cpp +++ b/src/block/cast/cast128.cpp @@ -102,7 +102,7 @@ void CAST_128::dec(const byte in[], byte out[]) const /************************************************* * CAST-128 Key Schedule * *************************************************/ -void CAST_128::key(const byte key[], u32bit length) +void CAST_128::key_schedule(const byte key[], u32bit length) { clear(); SecureBuffer<u32bit, 4> X; diff --git a/src/block/cast/cast128.h b/src/block/cast/cast128.h index b9d02cd7a..2004de51a 100644 --- a/src/block/cast/cast128.h +++ b/src/block/cast/cast128.h @@ -23,7 +23,7 @@ class BOTAN_DLL CAST_128 : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static void key_schedule(u32bit[16], u32bit[4]); diff --git a/src/block/cast/cast256.cpp b/src/block/cast/cast256.cpp index 24d3e0078..b8004851b 100644 --- a/src/block/cast/cast256.cpp +++ b/src/block/cast/cast256.cpp @@ -122,7 +122,7 @@ void CAST_256::dec(const byte in[], byte out[]) const /************************************************* * CAST-256 Key Schedule * *************************************************/ -void CAST_256::key(const byte key[], u32bit length) +void CAST_256::key_schedule(const byte key[], u32bit length) { SecureBuffer<u32bit, 8> TMP; for(u32bit j = 0; j != length; ++j) diff --git a/src/block/cast/cast256.h b/src/block/cast/cast256.h index cf0bcc953..e80208ad4 100644 --- a/src/block/cast/cast256.h +++ b/src/block/cast/cast256.h @@ -23,7 +23,7 @@ class BOTAN_DLL CAST_256 : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static const u32bit KEY_MASK[192]; static const byte KEY_ROT[32]; diff --git a/src/block/des/des.cpp b/src/block/des/des.cpp index 53a1a278e..f6453cff0 100644 --- a/src/block/des/des.cpp +++ b/src/block/des/des.cpp @@ -187,7 +187,7 @@ void DES::dec(const byte in[], byte out[]) const /************************************************* * DES Key Schedule * *************************************************/ -void DES::key(const byte key[], u32bit) +void DES::key_schedule(const byte key[], u32bit) { des_key_schedule(round_key.begin(), key); } @@ -249,7 +249,7 @@ void TripleDES::dec(const byte in[], byte out[]) const /************************************************* * TripleDES Key Schedule * *************************************************/ -void TripleDES::key(const byte key[], u32bit length) +void TripleDES::key_schedule(const byte key[], u32bit length) { des_key_schedule(&round_key[0], key); des_key_schedule(&round_key[32], key + 8); diff --git a/src/block/des/des.h b/src/block/des/des.h index 8cd490b3c..f3a0d56eb 100644 --- a/src/block/des/des.h +++ b/src/block/des/des.h @@ -23,7 +23,7 @@ class BOTAN_DLL DES : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 32> round_key; }; @@ -41,7 +41,7 @@ class BOTAN_DLL TripleDES : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 96> round_key; }; diff --git a/src/block/des/desx.cpp b/src/block/des/desx.cpp index fb76ec731..41c3bcd8d 100644 --- a/src/block/des/desx.cpp +++ b/src/block/des/desx.cpp @@ -31,7 +31,7 @@ void DESX::dec(const byte in[], byte out[]) const /************************************************* * DESX Key Schedule * *************************************************/ -void DESX::key(const byte key[], u32bit) +void DESX::key_schedule(const byte key[], u32bit) { K1.copy(key, 8); des.set_key(key + 8, 8); diff --git a/src/block/des/desx.h b/src/block/des/desx.h index c7e407b62..1fa68fcde 100644 --- a/src/block/des/desx.h +++ b/src/block/des/desx.h @@ -23,7 +23,7 @@ class BOTAN_DLL DESX : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<byte, 8> K1, K2; DES des; }; diff --git a/src/block/gost/gost.cpp b/src/block/gost/gost.cpp index dc2b397e7..a34dc6899 100644 --- a/src/block/gost/gost.cpp +++ b/src/block/gost/gost.cpp @@ -57,7 +57,7 @@ void GOST::dec(const byte in[], byte out[]) const /************************************************* * GOST Key Schedule * *************************************************/ -void GOST::key(const byte key[], u32bit) +void GOST::key_schedule(const byte key[], u32bit) { for(u32bit j = 0; j != 8; ++j) { diff --git a/src/block/gost/gost.h b/src/block/gost/gost.h index ef2897fae..57da96174 100644 --- a/src/block/gost/gost.h +++ b/src/block/gost/gost.h @@ -23,7 +23,7 @@ class BOTAN_DLL GOST : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static const u32bit SBOX1[256]; static const u32bit SBOX2[256]; diff --git a/src/block/idea/idea.cpp b/src/block/idea/idea.cpp index a2b076015..88dc04a3d 100644 --- a/src/block/idea/idea.cpp +++ b/src/block/idea/idea.cpp @@ -134,7 +134,7 @@ void IDEA::dec(const byte in[], byte out[]) const /************************************************* * IDEA Key Schedule * *************************************************/ -void IDEA::key(const byte key[], u32bit) +void IDEA::key_schedule(const byte key[], u32bit) { for(u32bit j = 0; j != 8; ++j) EK[j] = load_be<u16bit>(key, j); diff --git a/src/block/idea/idea.h b/src/block/idea/idea.h index 824a9c6ed..cd47111a6 100644 --- a/src/block/idea/idea.h +++ b/src/block/idea/idea.h @@ -23,7 +23,7 @@ class BOTAN_DLL IDEA : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u16bit, 52> EK, DK; }; diff --git a/src/block/kasumi/kasumi.cpp b/src/block/kasumi/kasumi.cpp index 4b56cc06f..4be6c41a8 100644 --- a/src/block/kasumi/kasumi.cpp +++ b/src/block/kasumi/kasumi.cpp @@ -185,7 +185,7 @@ void KASUMI::dec(const byte in[], byte out[]) const /************************************************* * KASUMI Key Schedule * *************************************************/ -void KASUMI::key(const byte key[], u32bit) +void KASUMI::key_schedule(const byte key[], u32bit) { static const u16bit RC[] = { 0x0123, 0x4567, 0x89AB, 0xCDEF, 0xFEDC, 0xBA98, 0x7654, 0x3210 }; diff --git a/src/block/kasumi/kasumi.h b/src/block/kasumi/kasumi.h index 40fa7c36a..27765e640 100644 --- a/src/block/kasumi/kasumi.h +++ b/src/block/kasumi/kasumi.h @@ -24,7 +24,7 @@ class BOTAN_DLL KASUMI : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u16bit, 64> EK; }; diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index 629badd3d..f35cbf424 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -52,7 +52,7 @@ void Lion::dec(const byte in[], byte out[]) const /************************************************* * Lion Key Schedule * *************************************************/ -void Lion::key(const byte key[], u32bit length) +void Lion::key_schedule(const byte key[], u32bit length) { clear(); diff --git a/src/block/lion/lion.h b/src/block/lion/lion.h index d541eb76e..b16db966e 100644 --- a/src/block/lion/lion.h +++ b/src/block/lion/lion.h @@ -27,7 +27,7 @@ class BOTAN_DLL Lion : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); const u32bit LEFT_SIZE, RIGHT_SIZE; diff --git a/src/block/lubyrack/lubyrack.cpp b/src/block/lubyrack/lubyrack.cpp index c9e6fc531..5304d14d6 100644 --- a/src/block/lubyrack/lubyrack.cpp +++ b/src/block/lubyrack/lubyrack.cpp @@ -69,7 +69,7 @@ void LubyRackoff::dec(const byte in[], byte out[]) const /************************************************* * Luby-Rackoff Key Schedule * *************************************************/ -void LubyRackoff::key(const byte key[], u32bit length) +void LubyRackoff::key_schedule(const byte key[], u32bit length) { K1.set(key, length / 2); K2.set(key + length / 2, length / 2); diff --git a/src/block/lubyrack/lubyrack.h b/src/block/lubyrack/lubyrack.h index ba5a4d052..6fedc38fe 100644 --- a/src/block/lubyrack/lubyrack.h +++ b/src/block/lubyrack/lubyrack.h @@ -26,7 +26,7 @@ class BOTAN_DLL LubyRackoff : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); HashFunction* hash; SecureVector<byte> K1, K2; }; diff --git a/src/block/mars/mars.cpp b/src/block/mars/mars.cpp index cc671fc06..5f93f2df4 100644 --- a/src/block/mars/mars.cpp +++ b/src/block/mars/mars.cpp @@ -213,7 +213,7 @@ void MARS::decrypt_round(u32bit& A, u32bit& B, u32bit& C, u32bit& D, /************************************************* * MARS Key Schedule * *************************************************/ -void MARS::key(const byte key[], u32bit length) +void MARS::key_schedule(const byte key[], u32bit length) { SecureBuffer<u32bit, 15> T; for(u32bit j = 0; j != length / 4; ++j) diff --git a/src/block/mars/mars.h b/src/block/mars/mars.h index 950c1eb6a..44f581549 100644 --- a/src/block/mars/mars.h +++ b/src/block/mars/mars.h @@ -20,7 +20,7 @@ class BOTAN_DLL MARS : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); void encrypt_round(u32bit&, u32bit&, u32bit&, u32bit&, u32bit) const; void decrypt_round(u32bit&, u32bit&, u32bit&, u32bit&, u32bit) const; diff --git a/src/block/misty1/misty1.cpp b/src/block/misty1/misty1.cpp index 523d11c84..234cf8e72 100644 --- a/src/block/misty1/misty1.cpp +++ b/src/block/misty1/misty1.cpp @@ -116,7 +116,7 @@ void MISTY1::dec(const byte in[], byte out[]) const /************************************************* * MISTY1 Key Schedule * *************************************************/ -void MISTY1::key(const byte key[], u32bit length) +void MISTY1::key_schedule(const byte key[], u32bit length) { SecureBuffer<u16bit, 32> KS; for(u32bit j = 0; j != length / 2; ++j) diff --git a/src/block/misty1/misty1.h b/src/block/misty1/misty1.h index 0bd3ca1e4..2092b7e91 100644 --- a/src/block/misty1/misty1.h +++ b/src/block/misty1/misty1.h @@ -23,7 +23,7 @@ class BOTAN_DLL MISTY1 : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static const byte EK_ORDER[100]; static const byte DK_ORDER[100]; diff --git a/src/block/noekeon/noekeon.cpp b/src/block/noekeon/noekeon.cpp index 437972fe5..1a783b432 100644 --- a/src/block/noekeon/noekeon.cpp +++ b/src/block/noekeon/noekeon.cpp @@ -146,7 +146,7 @@ void Noekeon::dec(const byte in[], byte out[]) const /************************************************* * Noekeon Key Schedule * *************************************************/ -void Noekeon::key(const byte key[], u32bit) +void Noekeon::key_schedule(const byte key[], u32bit) { u32bit A0 = load_be<u32bit>(key, 0); u32bit A1 = load_be<u32bit>(key, 1); diff --git a/src/block/noekeon/noekeon.h b/src/block/noekeon/noekeon.h index fb06f8c79..9d4e896b9 100644 --- a/src/block/noekeon/noekeon.h +++ b/src/block/noekeon/noekeon.h @@ -23,7 +23,7 @@ class BOTAN_DLL Noekeon : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static const byte RC[17]; diff --git a/src/block/rc2/rc2.cpp b/src/block/rc2/rc2.cpp index 6d764e5c4..56d0db78c 100644 --- a/src/block/rc2/rc2.cpp +++ b/src/block/rc2/rc2.cpp @@ -84,7 +84,7 @@ void RC2::dec(const byte in[], byte out[]) const /************************************************* * RC2 Key Schedule * *************************************************/ -void RC2::key(const byte key[], u32bit length) +void RC2::key_schedule(const byte key[], u32bit length) { static const byte TABLE[256] = { 0xD9, 0x78, 0xF9, 0xC4, 0x19, 0xDD, 0xB5, 0xED, 0x28, 0xE9, 0xFD, 0x79, diff --git a/src/block/rc2/rc2.h b/src/block/rc2/rc2.h index ddf5154b8..a1fe4ecfa 100644 --- a/src/block/rc2/rc2.h +++ b/src/block/rc2/rc2.h @@ -25,7 +25,7 @@ class BOTAN_DLL RC2 : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u16bit, 64> K; }; diff --git a/src/block/rc5/rc5.cpp b/src/block/rc5/rc5.cpp index 0c0229b6c..c4e4bf9b0 100644 --- a/src/block/rc5/rc5.cpp +++ b/src/block/rc5/rc5.cpp @@ -60,7 +60,7 @@ void RC5::dec(const byte in[], byte out[]) const /************************************************* * RC5 Key Schedule * *************************************************/ -void RC5::key(const byte key[], u32bit length) +void RC5::key_schedule(const byte key[], u32bit length) { const u32bit WORD_KEYLENGTH = (((length - 1) / 4) + 1), MIX_ROUNDS = 3*std::max(WORD_KEYLENGTH, S.size()); diff --git a/src/block/rc5/rc5.h b/src/block/rc5/rc5.h index bb91c3e68..6fbeb7c51 100644 --- a/src/block/rc5/rc5.h +++ b/src/block/rc5/rc5.h @@ -23,7 +23,7 @@ class BOTAN_DLL RC5 : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureVector<u32bit> S; const u32bit ROUNDS; }; diff --git a/src/block/rc6/rc6.cpp b/src/block/rc6/rc6.cpp index 67d765222..1295592d8 100644 --- a/src/block/rc6/rc6.cpp +++ b/src/block/rc6/rc6.cpp @@ -97,7 +97,7 @@ void RC6::dec(const byte in[], byte out[]) const /************************************************* * RC6 Key Schedule * *************************************************/ -void RC6::key(const byte key[], u32bit length) +void RC6::key_schedule(const byte key[], u32bit length) { const u32bit WORD_KEYLENGTH = (((length - 1) / 4) + 1), MIX_ROUNDS = 3*std::max(WORD_KEYLENGTH, S.size()); diff --git a/src/block/rc6/rc6.h b/src/block/rc6/rc6.h index 3517b4671..fd10070b8 100644 --- a/src/block/rc6/rc6.h +++ b/src/block/rc6/rc6.h @@ -23,7 +23,7 @@ class BOTAN_DLL RC6 : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 44> S; }; diff --git a/src/block/safer/safer_sk.cpp b/src/block/safer/safer_sk.cpp index 639130714..00e57e2a4 100644 --- a/src/block/safer/safer_sk.cpp +++ b/src/block/safer/safer_sk.cpp @@ -66,7 +66,7 @@ void SAFER_SK::dec(const byte in[], byte out[]) const /************************************************* * SAFER-SK Key Schedule * *************************************************/ -void SAFER_SK::key(const byte key[], u32bit) +void SAFER_SK::key_schedule(const byte key[], u32bit) { SecureBuffer<byte, 18> KB; diff --git a/src/block/safer/safer_sk.h b/src/block/safer/safer_sk.h index 121cf545b..0db32e20f 100644 --- a/src/block/safer/safer_sk.h +++ b/src/block/safer/safer_sk.h @@ -23,7 +23,7 @@ class BOTAN_DLL SAFER_SK : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static const byte EXP[256]; static const byte LOG[512]; diff --git a/src/block/seed/seed.cpp b/src/block/seed/seed.cpp index ecb6a86fa..0b63ff341 100644 --- a/src/block/seed/seed.cpp +++ b/src/block/seed/seed.cpp @@ -88,7 +88,7 @@ void SEED::dec(const byte in[], byte out[]) const /************************************************* * SEED Key Schedule * *************************************************/ -void SEED::key(const byte key[], u32bit) +void SEED::key_schedule(const byte key[], u32bit) { const u32bit RC[16] = { 0x9E3779B9, 0x3C6EF373, 0x78DDE6E6, 0xF1BBCDCC, diff --git a/src/block/seed/seed.h b/src/block/seed/seed.h index 9e96ec8c2..9f7d1cd2b 100644 --- a/src/block/seed/seed.h +++ b/src/block/seed/seed.h @@ -23,7 +23,7 @@ class BOTAN_DLL SEED : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); class G_FUNC { diff --git a/src/block/serpent/serpent.cpp b/src/block/serpent/serpent.cpp index 997daa8b1..07ff8b2cf 100644 --- a/src/block/serpent/serpent.cpp +++ b/src/block/serpent/serpent.cpp @@ -333,7 +333,7 @@ void Serpent::dec(const byte in[], byte out[]) const /************************************************* * Serpent Key Schedule * *************************************************/ -void Serpent::key(const byte key[], u32bit length) +void Serpent::key_schedule(const byte key[], u32bit length) { const u32bit PHI = 0x9E3779B9; diff --git a/src/block/serpent/serpent.h b/src/block/serpent/serpent.h index cac042185..fd26d9f7f 100644 --- a/src/block/serpent/serpent.h +++ b/src/block/serpent/serpent.h @@ -23,7 +23,7 @@ class BOTAN_DLL Serpent : public BlockCipher protected: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 132> round_key; }; diff --git a/src/block/serpent_ia32/serp_ia32.cpp b/src/block/serpent_ia32/serp_ia32.cpp index 2cd607c18..ec7574799 100644 --- a/src/block/serpent_ia32/serp_ia32.cpp +++ b/src/block/serpent_ia32/serp_ia32.cpp @@ -35,7 +35,7 @@ void Serpent_IA32::dec(const byte in[], byte out[]) const /************************************************* * Serpent Key Schedule * *************************************************/ -void Serpent_IA32::key(const byte key[], u32bit length) +void Serpent_IA32::key_schedule(const byte key[], u32bit length) { SecureBuffer<u32bit, 140> W; for(u32bit j = 0; j != length / 4; ++j) diff --git a/src/block/serpent_ia32/serp_ia32.h b/src/block/serpent_ia32/serp_ia32.h index 83079e9c2..4afa6a305 100644 --- a/src/block/serpent_ia32/serp_ia32.h +++ b/src/block/serpent_ia32/serp_ia32.h @@ -20,7 +20,7 @@ class BOTAN_DLL Serpent_IA32 : public Serpent private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); }; } diff --git a/src/block/skipjack/skipjack.cpp b/src/block/skipjack/skipjack.cpp index 3cad75436..62918a3fd 100644 --- a/src/block/skipjack/skipjack.cpp +++ b/src/block/skipjack/skipjack.cpp @@ -117,7 +117,7 @@ void Skipjack::step_Bi(u16bit& W2, u16bit& W3, u32bit round) const /************************************************* * Skipjack Key Schedule * *************************************************/ -void Skipjack::key(const byte key[], u32bit) +void Skipjack::key_schedule(const byte key[], u32bit) { static const byte F[256] = { 0xA3, 0xD7, 0x09, 0x83, 0xF8, 0x48, 0xF6, 0xF4, 0xB3, 0x21, 0x15, 0x78, diff --git a/src/block/skipjack/skipjack.h b/src/block/skipjack/skipjack.h index c7c9ec9b9..2d8956215 100644 --- a/src/block/skipjack/skipjack.h +++ b/src/block/skipjack/skipjack.h @@ -23,7 +23,7 @@ class BOTAN_DLL Skipjack : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); void step_A(u16bit&, u16bit&, u32bit) const; void step_B(u16bit&, u16bit&, u32bit) const; void step_Ai(u16bit&, u16bit&, u32bit) const; diff --git a/src/block/square/square.cpp b/src/block/square/square.cpp index f2b15499b..44fb26bfd 100644 --- a/src/block/square/square.cpp +++ b/src/block/square/square.cpp @@ -114,7 +114,7 @@ void Square::dec(const byte in[], byte out[]) const /************************************************* * Square Key Schedule * *************************************************/ -void Square::key(const byte key[], u32bit) +void Square::key_schedule(const byte key[], u32bit) { SecureBuffer<u32bit, 36> XEK, XDK; for(u32bit j = 0; j != 4; ++j) diff --git a/src/block/square/square.h b/src/block/square/square.h index 97326e7ea..4c4d89100 100644 --- a/src/block/square/square.h +++ b/src/block/square/square.h @@ -23,7 +23,7 @@ class BOTAN_DLL Square : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static void transform(u32bit[4]); diff --git a/src/block/tea/tea.cpp b/src/block/tea/tea.cpp index c5bd1b1fa..7b79d86d1 100644 --- a/src/block/tea/tea.cpp +++ b/src/block/tea/tea.cpp @@ -47,7 +47,7 @@ void TEA::dec(const byte in[], byte out[]) const /************************************************* * TEA Key Schedule * *************************************************/ -void TEA::key(const byte key[], u32bit) +void TEA::key_schedule(const byte key[], u32bit) { for(u32bit j = 0; j != 4; ++j) K[j] = load_be<u32bit>(key, j); diff --git a/src/block/tea/tea.h b/src/block/tea/tea.h index 71d4e02f9..b751eda4e 100644 --- a/src/block/tea/tea.h +++ b/src/block/tea/tea.h @@ -23,7 +23,7 @@ class BOTAN_DLL TEA : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 4> K; }; diff --git a/src/block/twofish/twofish.cpp b/src/block/twofish/twofish.cpp index b2357e347..d6bab2fc5 100644 --- a/src/block/twofish/twofish.cpp +++ b/src/block/twofish/twofish.cpp @@ -102,7 +102,7 @@ void Twofish::dec(const byte in[], byte out[]) const /************************************************* * Twofish Key Schedule * *************************************************/ -void Twofish::key(const byte key[], u32bit length) +void Twofish::key_schedule(const byte key[], u32bit length) { SecureBuffer<byte, 16> S; diff --git a/src/block/twofish/twofish.h b/src/block/twofish/twofish.h index f7788722c..39f0a6121 100644 --- a/src/block/twofish/twofish.h +++ b/src/block/twofish/twofish.h @@ -23,7 +23,7 @@ class BOTAN_DLL Twofish : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); static void rs_mul(byte[4], byte, u32bit); diff --git a/src/block/xtea/xtea.cpp b/src/block/xtea/xtea.cpp index db5c7effc..d13173f02 100644 --- a/src/block/xtea/xtea.cpp +++ b/src/block/xtea/xtea.cpp @@ -44,7 +44,7 @@ void XTEA::dec(const byte in[], byte out[]) const /************************************************* * XTEA Key Schedule * *************************************************/ -void XTEA::key(const byte key[], u32bit) +void XTEA::key_schedule(const byte key[], u32bit) { static const u32bit DELTAS[64] = { 0x00000000, 0x9E3779B9, 0x9E3779B9, 0x3C6EF372, 0x3C6EF372, 0xDAA66D2B, diff --git a/src/block/xtea/xtea.h b/src/block/xtea/xtea.h index 03b41f683..630da4064 100644 --- a/src/block/xtea/xtea.h +++ b/src/block/xtea/xtea.h @@ -23,7 +23,7 @@ class BOTAN_DLL XTEA : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 64> EK; }; diff --git a/src/engine/openssl/ossl_bc.cpp b/src/engine/openssl/ossl_bc.cpp index 407bb3cde..1863ad477 100644 --- a/src/engine/openssl/ossl_bc.cpp +++ b/src/engine/openssl/ossl_bc.cpp @@ -29,7 +29,7 @@ class EVP_BlockCipher : public BlockCipher private: void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); std::string cipher_name; mutable EVP_CIPHER_CTX encrypt, decrypt; }; @@ -108,7 +108,7 @@ void EVP_BlockCipher::dec(const byte in[], byte out[]) const /************************************************* * Set the key * *************************************************/ -void EVP_BlockCipher::key(const byte key[], u32bit length) +void EVP_BlockCipher::key_schedule(const byte key[], u32bit length) { SecureVector<byte> full_key(key, length); diff --git a/src/engine/openssl/ossl_rc4.cpp b/src/engine/openssl/ossl_rc4.cpp index eb8e9ded8..ed5c9714f 100644 --- a/src/engine/openssl/ossl_rc4.cpp +++ b/src/engine/openssl/ossl_rc4.cpp @@ -25,7 +25,7 @@ class OpenSSL_ARC4 : public StreamCipher ~OpenSSL_ARC4() { clear(); } private: void cipher(const byte[], byte[], u32bit); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); const u32bit SKIP; RC4_KEY state; @@ -44,7 +44,7 @@ std::string OpenSSL_ARC4::name() const /************************************************* * ARC4 Key Schedule * *************************************************/ -void OpenSSL_ARC4::key(const byte key[], u32bit length) +void OpenSSL_ARC4::key_schedule(const byte key[], u32bit length) { RC4_set_key(&state, length, key); byte dummy = 0; diff --git a/src/mac/cbc_mac/cbc_mac.cpp b/src/mac/cbc_mac/cbc_mac.cpp index de9a3c17d..cbbf77991 100644 --- a/src/mac/cbc_mac/cbc_mac.cpp +++ b/src/mac/cbc_mac/cbc_mac.cpp @@ -52,7 +52,7 @@ void CBC_MAC::final_result(byte mac[]) /************************************************* * CBC-MAC Key Schedule * *************************************************/ -void CBC_MAC::key(const byte key[], u32bit length) +void CBC_MAC::key_schedule(const byte key[], u32bit length) { e->set_key(key, length); } diff --git a/src/mac/cbc_mac/cbc_mac.h b/src/mac/cbc_mac/cbc_mac.h index 7e93097d5..1112970d6 100644 --- a/src/mac/cbc_mac/cbc_mac.h +++ b/src/mac/cbc_mac/cbc_mac.h @@ -26,7 +26,7 @@ class BOTAN_DLL CBC_MAC : public MessageAuthenticationCode private: void add_data(const byte[], u32bit); void final_result(byte[]); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); BlockCipher* e; SecureVector<byte> state; diff --git a/src/mac/cmac/cmac.cpp b/src/mac/cmac/cmac.cpp index 937c15c63..bd3f174c1 100644 --- a/src/mac/cmac/cmac.cpp +++ b/src/mac/cmac/cmac.cpp @@ -87,7 +87,7 @@ void CMAC::final_result(byte mac[]) /************************************************* * CMAC Key Schedule * *************************************************/ -void CMAC::key(const byte key[], u32bit length) +void CMAC::key_schedule(const byte key[], u32bit length) { clear(); e->set_key(key, length); diff --git a/src/mac/cmac/cmac.h b/src/mac/cmac/cmac.h index 66eb46a69..9f745ee22 100644 --- a/src/mac/cmac/cmac.h +++ b/src/mac/cmac/cmac.h @@ -29,7 +29,7 @@ class BOTAN_DLL CMAC : public MessageAuthenticationCode private: void add_data(const byte[], u32bit); void final_result(byte[]); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); BlockCipher* e; SecureVector<byte> buffer, state, B, P; diff --git a/src/mac/hmac/hmac.cpp b/src/mac/hmac/hmac.cpp index 6401b0000..15552b8ea 100644 --- a/src/mac/hmac/hmac.cpp +++ b/src/mac/hmac/hmac.cpp @@ -32,7 +32,7 @@ void HMAC::final_result(byte mac[]) /************************************************* * HMAC Key Schedule * *************************************************/ -void HMAC::key(const byte key[], u32bit length) +void HMAC::key_schedule(const byte key[], u32bit length) { hash->clear(); std::fill(i_key.begin(), i_key.end(), 0x36); diff --git a/src/mac/hmac/hmac.h b/src/mac/hmac/hmac.h index 122441120..c3081edfd 100644 --- a/src/mac/hmac/hmac.h +++ b/src/mac/hmac/hmac.h @@ -26,7 +26,7 @@ class BOTAN_DLL HMAC : public MessageAuthenticationCode private: void add_data(const byte[], u32bit); void final_result(byte[]); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); HashFunction* hash; SecureVector<byte> i_key, o_key; }; diff --git a/src/mac/ssl3mac/ssl3_mac.cpp b/src/mac/ssl3mac/ssl3_mac.cpp index d2aec7825..8bd22a779 100644 --- a/src/mac/ssl3mac/ssl3_mac.cpp +++ b/src/mac/ssl3mac/ssl3_mac.cpp @@ -30,7 +30,7 @@ void SSL3_MAC::final_result(byte mac[]) /************************************************* * SSL3-MAC Key Schedule * *************************************************/ -void SSL3_MAC::key(const byte key[], u32bit length) +void SSL3_MAC::key_schedule(const byte key[], u32bit length) { hash->clear(); std::fill(i_key.begin(), i_key.end(), 0x36); diff --git a/src/mac/ssl3mac/ssl3_mac.h b/src/mac/ssl3mac/ssl3_mac.h index b9875a0c1..fad9e74cd 100644 --- a/src/mac/ssl3mac/ssl3_mac.h +++ b/src/mac/ssl3mac/ssl3_mac.h @@ -26,7 +26,7 @@ class BOTAN_DLL SSL3_MAC : public MessageAuthenticationCode private: void add_data(const byte[], u32bit); void final_result(byte[]); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); HashFunction* hash; SecureVector<byte> i_key, o_key; diff --git a/src/mac/x919_mac/x919_mac.cpp b/src/mac/x919_mac/x919_mac.cpp index 5e03b2e6c..9db32c8a2 100644 --- a/src/mac/x919_mac/x919_mac.cpp +++ b/src/mac/x919_mac/x919_mac.cpp @@ -51,7 +51,7 @@ void ANSI_X919_MAC::final_result(byte mac[]) /************************************************* * ANSI X9.19 MAC Key Schedule * *************************************************/ -void ANSI_X919_MAC::key(const byte key[], u32bit length) +void ANSI_X919_MAC::key_schedule(const byte key[], u32bit length) { e->set_key(key, 8); if(length == 8) d->set_key(key, 8); diff --git a/src/mac/x919_mac/x919_mac.h b/src/mac/x919_mac/x919_mac.h index 46196f8f4..a2a40e3ca 100644 --- a/src/mac/x919_mac/x919_mac.h +++ b/src/mac/x919_mac/x919_mac.h @@ -26,7 +26,7 @@ class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode private: void add_data(const byte[], u32bit); void final_result(byte[]); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); BlockCipher* e; BlockCipher* d; diff --git a/src/stream/arc4/arc4.cpp b/src/stream/arc4/arc4.cpp index 238567cdc..f422582cc 100644 --- a/src/stream/arc4/arc4.cpp +++ b/src/stream/arc4/arc4.cpp @@ -57,7 +57,7 @@ void ARC4::generate() /************************************************* * ARC4 Key Schedule * *************************************************/ -void ARC4::key(const byte key[], u32bit length) +void ARC4::key_schedule(const byte key[], u32bit length) { clear(); for(u32bit j = 0; j != 256; ++j) diff --git a/src/stream/arc4/arc4.h b/src/stream/arc4/arc4.h index 0976ce7ea..d399e2144 100644 --- a/src/stream/arc4/arc4.h +++ b/src/stream/arc4/arc4.h @@ -24,7 +24,7 @@ class BOTAN_DLL ARC4 : public StreamCipher ~ARC4() { clear(); } private: void cipher(const byte[], byte[], u32bit); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); void generate(); const u32bit SKIP; diff --git a/src/stream/salsa20/salsa20.cpp b/src/stream/salsa20/salsa20.cpp index c2c8f289f..e6a190fc3 100644 --- a/src/stream/salsa20/salsa20.cpp +++ b/src/stream/salsa20/salsa20.cpp @@ -120,7 +120,7 @@ void Salsa20::cipher(const byte in[], byte out[], u32bit length) /************************************************* * Salsa20 Key Schedule * *************************************************/ -void Salsa20::key(const byte key[], u32bit length) +void Salsa20::key_schedule(const byte key[], u32bit length) { static const u32bit TAU[] = { 0x61707865, 0x3120646e, 0x79622d36, 0x6b206574 }; diff --git a/src/stream/salsa20/salsa20.h b/src/stream/salsa20/salsa20.h index 345a8dbbd..d40b84cfc 100644 --- a/src/stream/salsa20/salsa20.h +++ b/src/stream/salsa20/salsa20.h @@ -26,7 +26,7 @@ class BOTAN_DLL Salsa20 : public StreamCipher ~Salsa20() { clear(); } private: void cipher(const byte[], byte[], u32bit); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); SecureBuffer<u32bit, 16> state; diff --git a/src/stream/turing/turing.cpp b/src/stream/turing/turing.cpp index df0d3f5e8..bdf320364 100644 --- a/src/stream/turing/turing.cpp +++ b/src/stream/turing/turing.cpp @@ -237,7 +237,7 @@ void Turing::gen_sbox(MemoryRegion<u32bit>& S, u32bit which, /************************************************* * Turing Key Schedule * *************************************************/ -void Turing::key(const byte key[], u32bit length) +void Turing::key_schedule(const byte key[], u32bit length) { K.create(length / 4); for(u32bit j = 0; j != length; ++j) diff --git a/src/stream/turing/turing.h b/src/stream/turing/turing.h index f50fd9370..018196fd3 100644 --- a/src/stream/turing/turing.h +++ b/src/stream/turing/turing.h @@ -22,7 +22,7 @@ class BOTAN_DLL Turing : public StreamCipher Turing() : StreamCipher(4, 32, 4) { position = 0; } private: void cipher(const byte[], byte[], u32bit); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); void resync(const byte[], u32bit); void generate(); diff --git a/src/stream/wid_wake/wid_wake.cpp b/src/stream/wid_wake/wid_wake.cpp index d7ebdece0..c14652c54 100644 --- a/src/stream/wid_wake/wid_wake.cpp +++ b/src/stream/wid_wake/wid_wake.cpp @@ -70,7 +70,7 @@ void WiderWake_41_BE::generate(u32bit length) /************************************************* * WiderWake Key Schedule * *************************************************/ -void WiderWake_41_BE::key(const byte key[], u32bit) +void WiderWake_41_BE::key_schedule(const byte key[], u32bit) { for(u32bit j = 0; j != 4; ++j) t_key[j] = load_be<u32bit>(key, j); diff --git a/src/stream/wid_wake/wid_wake.h b/src/stream/wid_wake/wid_wake.h index 284572910..d73eee2d5 100644 --- a/src/stream/wid_wake/wid_wake.h +++ b/src/stream/wid_wake/wid_wake.h @@ -22,7 +22,7 @@ class BOTAN_DLL WiderWake_41_BE : public StreamCipher WiderWake_41_BE() : StreamCipher(16, 16, 1, 8) {} private: void cipher(const byte[], byte[], u32bit); - void key(const byte[], u32bit); + void key_schedule(const byte[], u32bit); void resync(const byte[], u32bit); void generate(u32bit); diff --git a/src/sym_algo/sym_algo.h b/src/sym_algo/sym_algo.h index dbefbe4ca..d71163ead 100644 --- a/src/sym_algo/sym_algo.h +++ b/src/sym_algo/sym_algo.h @@ -44,19 +44,19 @@ class BOTAN_DLL SymmetricAlgorithm * Set the symmetric key of this object. * @param key the SymmetricKey to be set. */ - void set_key(const SymmetricKey& skey) throw(Invalid_Key_Length) - { set_key(skey.begin(), skey.length()); } + void set_key(const SymmetricKey& key) throw(Invalid_Key_Length) + { set_key(key.begin(), key.length()); } /** * Set the symmetric key of this object. * @param key the to be set as a byte array. * @param the length of the byte array. */ - void set_key(const byte skey[], u32bit length) throw(Invalid_Key_Length) + void set_key(const byte key[], u32bit length) throw(Invalid_Key_Length) { if(!valid_keylength(length)) throw Invalid_Key_Length(name(), length); - key(skey, length); + key_schedule(key, length); } /** @@ -85,7 +85,7 @@ class BOTAN_DLL SymmetricAlgorithm virtual ~SymmetricAlgorithm() {} private: - virtual void key(const byte[], u32bit) = 0; + virtual void key_schedule(const byte[], u32bit) = 0; }; /** |