aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/aes_intel
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-07 23:40:31 +0000
committerlloyd <[email protected]>2010-09-07 23:40:31 +0000
commit197f7cd4f744ae8246832343dc514296632554b2 (patch)
tree63963dfab01e29ce32be4c1d43e62506d9f0246d /src/block/aes_intel
parent5f83d344e49a6d62cd8989d9fb8f8ca80ed48fc1 (diff)
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.
Diffstat (limited to 'src/block/aes_intel')
-rw-r--r--src/block/aes_intel/aes_intel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/block/aes_intel/aes_intel.cpp b/src/block/aes_intel/aes_intel.cpp
index 211bb3b47..c52f3fcd3 100644
--- a/src/block/aes_intel/aes_intel.cpp
+++ b/src/block/aes_intel/aes_intel.cpp
@@ -306,8 +306,8 @@ void AES_128_Intel::key_schedule(const byte key[], u32bit)
*/
void AES_128_Intel::clear()
{
- EK.clear();
- DK.clear();
+ zeroise(EK);
+ zeroise(DK);
}
/*
@@ -522,8 +522,8 @@ void AES_192_Intel::key_schedule(const byte key[], u32bit)
*/
void AES_192_Intel::clear()
{
- EK.clear();
- DK.clear();
+ zeroise(EK);
+ zeroise(DK);
}
/*
@@ -772,8 +772,8 @@ void AES_256_Intel::key_schedule(const byte key[], u32bit)
*/
void AES_256_Intel::clear()
{
- EK.clear();
- DK.clear();
+ zeroise(EK);
+ zeroise(DK);
}
}