Public Types |
Public Member Functions |
Static Public Attributes |
Protected Types |
Protected Member Functions |
List of all members
nil::crypto3::block::basic_shacal Class Reference
#include <basic_shacal.hpp>
Inheritance diagram for nil::crypto3::block::basic_shacal:
Collaboration diagram for nil::crypto3::block::basic_shacal:
Public Types | |
typedef policy_type::block_type | block_type |
typedef policy_type::key_type | key_type |
typedef policy_type::schedule_type | schedule_type |
typedef policy_type::word_type | word_type |
Public Member Functions | |
block_type | decrypt (const block_type &ciphertext) const |
block_type | encrypt (const block_type &plaintext) const |
Static Public Attributes | |
constexpr static const std::size_t | block_bits = policy_type::block_bits |
constexpr static const std::size_t | block_words = policy_type::block_words |
constexpr static const std::size_t | key_bits = policy_type::key_bits |
constexpr static const std::size_t | key_words = policy_type::key_words |
constexpr static const std::size_t | rounds = policy_type::rounds |
constexpr static const std::size_t | word_bits = policy_type::word_bits |
Protected Types | |
typedef detail::shacal_policy | policy_type |
Protected Member Functions | |
basic_shacal (const schedule_type &s) | |
virtual | ~basic_shacal () |
Detailed Description
Encrypt implemented directly from the SHA standard as found at http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
Decrypt is a straight-forward inverse
In SHA terminology:
- plaintext = H^(i-1)
- ciphertext = H^(i)
- key = M^(i)
- schedule = W
The algorithms for SHA(-0) and SHA-1 are identical apart from the key scheduling, so encapsulate that as a class that takes an already-prepared schedule. (Constructor is protected to help keep people from accidentally giving it just a key in a schedule.)
Member Typedef Documentation
◆ block_type
◆ key_type
◆ policy_type
|
protected |
◆ schedule_type
◆ word_type
Constructor & Destructor Documentation
◆ basic_shacal()
|
inlineprotected |
◆ ~basic_shacal()
|
inlineprotectedvirtual |
Member Function Documentation
◆ decrypt()
|
inline |
◆ encrypt()
|
inline |
Member Data Documentation
◆ block_bits
|
staticconstexpr |
◆ block_words
|
staticconstexpr |
◆ key_bits
|
staticconstexpr |
◆ key_words
|
staticconstexpr |
◆ rounds
|
staticconstexpr |
◆ word_bits
|
staticconstexpr |
The documentation for this class was generated from the following file: