diff options
author | lloyd <[email protected]> | 2012-11-29 18:58:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-11-29 18:58:54 +0000 |
commit | 12c128c1fbb483ae9042b47fc544adf0e55d0693 (patch) | |
tree | 46aa39dcfb055c84778fa842a2d66249f6d175c8 /src/block/gost_28147 | |
parent | 2d8dff7079d4a8eabd848bd0e88b38a2112b333e (diff) |
Add new helper zap which zeros a vector, clears it, and then calls
shrink_to_fit to actually deallocate memory.
Diffstat (limited to 'src/block/gost_28147')
-rw-r--r-- | src/block/gost_28147/gost_28147.cpp | 5 | ||||
-rw-r--r-- | src/block/gost_28147/gost_28147.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/block/gost_28147/gost_28147.cpp b/src/block/gost_28147/gost_28147.cpp index db144a81f..09ca9a57e 100644 --- a/src/block/gost_28147/gost_28147.cpp +++ b/src/block/gost_28147/gost_28147.cpp @@ -169,4 +169,9 @@ void GOST_28147_89::key_schedule(const byte key[], size_t) EK[i] = load_le<u32bit>(key, i); } +void GOST_28147_89::clear() + { + zap(EK); + } + } diff --git a/src/block/gost_28147/gost_28147.h b/src/block/gost_28147/gost_28147.h index 7c77fea06..34b99197e 100644 --- a/src/block/gost_28147/gost_28147.h +++ b/src/block/gost_28147/gost_28147.h @@ -55,7 +55,7 @@ class BOTAN_DLL GOST_28147_89 : public Block_Cipher_Fixed_Params<8, 32> void encrypt_n(const byte in[], byte out[], size_t blocks) const; void decrypt_n(const byte in[], byte out[], size_t blocks) const; - void clear() { EK.clear(); } + void clear(); std::string name() const; BlockCipher* clone() const { return new GOST_28147_89(SBOX); } |