summaryrefslogtreecommitdiff
path: root/sha3.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 /sha3.h
parent9defd0afcd776b7d3232ff28624c478ec013f8cb (diff)
downloadcryptopp-git-57465b5ae3065f2d42a8ac94776957acf1060b4c.tar.gz
Update documentation
Diffstat (limited to 'sha3.h')
-rw-r--r--sha3.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/sha3.h b/sha3.h
index a5ded799..46dd5b99 100644
--- a/sha3.h
+++ b/sha3.h
@@ -56,16 +56,26 @@ class SHA3_Final : public SHA3
public:
CRYPTOPP_CONSTANT(DIGESTSIZE = T_DigestSize)
CRYPTOPP_CONSTANT(BLOCKSIZE = 200 - 2 * DIGESTSIZE)
+ static std::string StaticAlgorithmName()
+ { return "SHA3-" + IntToString(DIGESTSIZE * 8); }
/// \brief Construct a SHA3-X message digest
SHA3_Final() : SHA3(DIGESTSIZE) {}
- static std::string StaticAlgorithmName() { return "SHA3-" + IntToString(DIGESTSIZE * 8); }
+
+ /// \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:
#if !defined(__BORLANDC__)
- CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math
- CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > (int)T_DigestSize); // this is a general expectation by HMAC
+ // 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)T_DigestSize);
#endif
};