aboutsummaryrefslogtreecommitdiffstats
path: root/src/aead/eax/eax.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-03-27 14:03:58 +0000
committerlloyd <[email protected]>2013-03-27 14:03:58 +0000
commit7703ed769010f9ef4d037be1e9d1183a854f8348 (patch)
tree5766676f2c8c89d39b953c10466cb8d996bddf95 /src/aead/eax/eax.cpp
parent86ecbb4fc9d4db13281a2cb689c604222900a6e7 (diff)
Move GCM to new AEAD interface
Diffstat (limited to 'src/aead/eax/eax.cpp')
-rw-r--r--src/aead/eax/eax.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/aead/eax/eax.cpp b/src/aead/eax/eax.cpp
index d03d6ec5e..8a7287062 100644
--- a/src/aead/eax/eax.cpp
+++ b/src/aead/eax/eax.cpp
@@ -45,11 +45,30 @@ EAX_Mode::EAX_Mode(BlockCipher* cipher, size_t tag_size) :
throw Invalid_Argument(name() + ": Bad tag size " + std::to_string(tag_size));
}
+void EAX_Mode::clear()
+ {
+ m_cipher.reset();
+ m_ctr.reset();
+ m_cmac.reset();
+ zeroise(m_ad_mac);
+ zeroise(m_nonce_mac);
+ }
+
+std::string EAX_Mode::name() const
+ {
+ return (m_cipher->name() + "/EAX");
+ }
+
size_t EAX_Mode::update_granularity() const
{
return 8 * m_cipher->parallel_bytes();
}
+Key_Length_Specification EAX_Mode::key_spec() const
+ {
+ return m_cipher->key_spec();
+ }
+
/*
* Set the EAX key
*/
@@ -86,14 +105,6 @@ secure_vector<byte> EAX_Mode::start(const byte nonce[], size_t nonce_len)
return secure_vector<byte>();
}
-/*
-* Return the name of this cipher mode
-*/
-std::string EAX_Mode::name() const
- {
- return (m_cipher->name() + "/EAX");
- }
-
void EAX_Encryption::update(secure_vector<byte>& buffer)
{
m_ctr->cipher(&buffer[0], &buffer[0], buffer.size());