diff options
author | lloyd <[email protected]> | 2010-06-21 14:21:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-06-21 14:21:37 +0000 |
commit | a62eaa2f7447d930db84f966986736d30ef522bb (patch) | |
tree | 1786359cb024ca752e42cea8b92a002e6c558f7a /src/block/serpent/serpent.h | |
parent | f43ddc74ade3a921ea7c3513aeb6306fc2af6982 (diff) |
Make Serpent's key_schedule and actual round keys private. Add
protected accessor functions for get and set. Set is needed by the x86
version since it implements the key schedule directly.
Diffstat (limited to 'src/block/serpent/serpent.h')
-rw-r--r-- | src/block/serpent/serpent.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/block/serpent/serpent.h b/src/block/serpent/serpent.h index 1c13d00f9..dc81d4178 100644 --- a/src/block/serpent/serpent.h +++ b/src/block/serpent/serpent.h @@ -26,8 +26,22 @@ class BOTAN_DLL Serpent : public BlockCipher BlockCipher* clone() const { return new Serpent; } Serpent() : BlockCipher(16, 16, 32, 8) {} protected: + /** + * For use by subclasses using SIMD, asm, etc + * @return const reference to the key schedule + */ + const SecureVector<u32bit, 132>& get_round_keys() const + { return round_key; } + + /** + * For use by subclasses that implement the key schedule + * @param ks is the new key schedule value to set + */ + void set_round_keys(const u32bit ks[132]) + { round_key.set(ks, 132); } + + private: void key_schedule(const byte key[], u32bit length); - SecureVector<u32bit, 132> round_key; }; |