summaryrefslogtreecommitdiff
path: root/shake.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-02-12 23:38:38 -0500
committerJeffrey Walton <noloader@gmail.com>2019-02-12 23:38:38 -0500
commit57465b5ae3065f2d42a8ac94776957acf1060b4c (patch)
tree981a97eabd2f23aa34abc450e7b6a1f3f9ffbaa2 /shake.h
parent9defd0afcd776b7d3232ff28624c478ec013f8cb (diff)
downloadcryptopp-git-57465b5ae3065f2d42a8ac94776957acf1060b4c.tar.gz
Update documentation
Diffstat (limited to 'shake.h')
-rw-r--r--shake.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/shake.h b/shake.h
index 6f1e7786..a63d1ce9 100644
--- a/shake.h
+++ b/shake.h
@@ -56,15 +56,27 @@ class SHAKE_Final : public SHAKE
public:
CRYPTOPP_CONSTANT(DIGESTSIZE = (T_Strength == 128 ? 32 : 64))
CRYPTOPP_CONSTANT(BLOCKSIZE = (T_Strength == 128 ? 1344/8 : 1088/8))
- static std::string StaticAlgorithmName() { return "SHAKE-" + IntToString(T_Strength); }
+ static std::string StaticAlgorithmName()
+ { return "SHAKE-" + IntToString(T_Strength); }
/// \brief Construct a SHAKE-X message digest
SHAKE_Final() : SHAKE(DIGESTSIZE) {}
+
+ /// \brief Provides the block size of the compression function
+ /// \return block size of the compression function, in bytes
+ /// \details BlockSize() will return 0 if the hash is not block based
+ /// or does not have an equivalent block size. For example, Keccak
+ /// and SHA-3 do not have a block size, but they do have an equivalent
+ /// block size called rate expressed as <tt>r</tt>.
unsigned int BlockSize() const { return BLOCKSIZE; }
private:
- CRYPTOPP_COMPILE_ASSERT(T_Strength == 128 || T_Strength == 256);
- CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math
+#if !defined(__BORLANDC__)
+ // ensure there was no underflow in the math
+ CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200);
+ // this is a general expectation by HMAC
+ CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > (int)DIGESTSIZE);
+#endif
};
/// \brief SHAKE128 message digest