From 197f7cd4f744ae8246832343dc514296632554b2 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 7 Sep 2010 23:40:31 +0000 Subject: Big, invasive but mostly automated change, with a further attempt at harmonising MemoryRegion with std::vector: The MemoryRegion::clear() function would zeroise the buffer, but keep the memory allocated and the size unchanged. This is very different from STL's clear(), which is basically the equivalent to what is called destroy() in MemoryRegion. So to be able to replace MemoryRegion with a std::vector, we have to rename destroy() to clear() and we have to expose the current functionality of clear() in some other way, since vector doesn't support this operation. Do so by adding a global function named zeroise() which takes a MemoryRegion which is zeroed. Remove clear() to ensure all callers are updated. --- src/block/gost_28147/gost_28147.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/block/gost_28147/gost_28147.h') diff --git a/src/block/gost_28147/gost_28147.h b/src/block/gost_28147/gost_28147.h index ec23466f4..9d845ae72 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 BlockCipher void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; - void clear() { EK.clear(); } + void clear() { zeroise(EK); } std::string name() const { return "GOST-28147-89"; } BlockCipher* clone() const { return new GOST_28147_89(SBOX); } -- cgit v1.2.3