summaryrefslogtreecommitdiff
path: root/authenc.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-10-07 10:32:43 -0400
committerJeffrey Walton <noloader@gmail.com>2017-10-07 10:32:43 -0400
commitebcd91a0ac1b1aa3f4723ae19dab0c74eccad495 (patch)
tree9ced8006fc13ac427da1f056c118add84bf5151f /authenc.h
parent01e46aa474f6310d281b29ba41b0e6bc696873aa (diff)
downloadcryptopp-git-ebcd91a0ac1b1aa3f4723ae19dab0c74eccad495.tar.gz
Make UncheckedSetKey in authenc.h
UncheckedSetKey has traditionally been a protected member function. The public API traditionally uses SetKey (and friends) to set the key. Internally, SetKey may call UncheckedSetKey. It looks like UncheckedSetKey was made public when authenticated encryption support was added. Its probably not a good idea to have users calling UncheckedSetKey. Most (all?) of the time it does nothing for authenc modes. The other remaining cases it may not work as expected.
Diffstat (limited to 'authenc.h')
-rw-r--r--authenc.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/authenc.h b/authenc.h
index a0dd5a1c..d09efcc2 100644
--- a/authenc.h
+++ b/authenc.h
@@ -48,14 +48,6 @@ public:
bool IsRandomAccess() const {return false;}
bool IsSelfInverting() const {return true;}
- //! \brief Sets the key for this object without performing parameter validation
- //! \param key a byte buffer used to key the cipher
- //! \param length the length of the byte buffer
- //! \param params additional parameters passed as NameValuePairs
- //! \details key must be at least DEFAULT_KEYLENGTH in length.
- void UncheckedSetKey(const byte * key, unsigned int length,const CryptoPP::NameValuePairs &params)
- {CRYPTOPP_UNUSED(key), CRYPTOPP_UNUSED(length), CRYPTOPP_UNUSED(params); CRYPTOPP_ASSERT(false);}
-
void SetKey(const byte *userKey, size_t keylength, const NameValuePairs &params);
void Restart() {if (m_state > State_KeySet) m_state = State_KeySet;}
void Resynchronize(const byte *iv, int length=-1);
@@ -64,6 +56,9 @@ public:
void TruncatedFinal(byte *mac, size_t macSize);
protected:
+ void UncheckedSetKey(const byte * key, unsigned int length,const CryptoPP::NameValuePairs &params)
+ {CRYPTOPP_UNUSED(key), CRYPTOPP_UNUSED(length), CRYPTOPP_UNUSED(params); CRYPTOPP_ASSERT(false);}
+
void AuthenticateData(const byte *data, size_t len);
const SymmetricCipher & GetSymmetricCipher() const
{return const_cast<AuthenticatedSymmetricCipherBase *>(this)->AccessSymmetricCipher();};