Classes |
Public Types |
Public Member Functions |
Static Public Attributes |
Protected Member Functions |
Static Protected Member Functions |
Protected Attributes |
List of all members
nil::crypto3::block::shacal2< BlockBits > Class Template Reference
Shacal2. Merkle-Damgård construction foundation for SHA2 hashes. Accepts up to a 512-bit key. Fast and seemingly very secure, but obscure. Standardized by NESSIE. More...
#include <shacal2.hpp>
Collaboration diagram for nil::crypto3::block::shacal2< BlockBits >:
Classes | |
struct | stream_processor |
Public Types | |
typedef policy_type::block_type | block_type |
typedef stream_endian::little_octet_big_bit | endian_type |
typedef policy_type::key_schedule_type | key_schedule_type |
typedef policy_type::key_type | key_type |
typedef policy_type::word_type | word_type |
Public Member Functions | |
block_type | decrypt (const block_type &ciphertext) const |
block_type | encrypt (block_type const &plaintext) const |
shacal2 (const key_type &key) | |
shacal2 (key_schedule_type s) | |
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 |
static const std::size_t | rounds = policy_type::rounds |
constexpr static const std::size_t | version = BlockBits |
constexpr static const std::size_t | word_bits = policy_type::word_bits |
Protected Member Functions | |
block_type | decrypt_block (const block_type &ciphertext) const |
block_type | encrypt_block (const block_type &plaintext) const |
Static Protected Member Functions | |
static key_schedule_type | build_schedule (const key_type &key) |
static block_type | decrypt_block (const key_schedule_type &schedule, const block_type &ciphertext) |
static block_type | encrypt_block (const key_schedule_type &schedule, block_type const &plaintext) |
static void | prepare_schedule (key_schedule_type &schedule) |
Protected Attributes | |
const key_schedule_type | schedule |
Detailed Description
template<std::size_t BlockBits>
class nil::crypto3::block::shacal2< BlockBits >
Shacal2. Merkle-Damgård construction foundation for SHA2 hashes. Accepts up to a 512-bit key. Fast and seemingly very secure, but obscure. Standardized by NESSIE.
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
- Template Parameters
-
BlockBits Block cipher block bits. Available values are: 256, 512
Member Typedef Documentation
◆ block_type
template<std::size_t BlockBits>
typedef policy_type::block_type nil::crypto3::block::shacal2< BlockBits >::block_type |
◆ endian_type
template<std::size_t BlockBits>
typedef stream_endian::little_octet_big_bit nil::crypto3::block::shacal2< BlockBits >::endian_type |
◆ key_schedule_type
template<std::size_t BlockBits>
typedef policy_type::key_schedule_type nil::crypto3::block::shacal2< BlockBits >::key_schedule_type |
◆ key_type
template<std::size_t BlockBits>
typedef policy_type::key_type nil::crypto3::block::shacal2< BlockBits >::key_type |
◆ word_type
template<std::size_t BlockBits>
typedef policy_type::word_type nil::crypto3::block::shacal2< BlockBits >::word_type |
Constructor & Destructor Documentation
◆ shacal2() [1/2]
template<std::size_t BlockBits>
|
inline |
◆ shacal2() [2/2]
template<std::size_t BlockBits>
|
inline |
Member Function Documentation
◆ build_schedule()
template<std::size_t BlockBits>
|
inlinestaticprotected |
◆ decrypt()
template<std::size_t BlockBits>
|
inline |
◆ decrypt_block() [1/2]
template<std::size_t BlockBits>
|
inlineprotected |
◆ decrypt_block() [2/2]
template<std::size_t BlockBits>
|
inlinestaticprotected |
◆ encrypt()
template<std::size_t BlockBits>
|
inline |
◆ encrypt_block() [1/2]
template<std::size_t BlockBits>
|
inlineprotected |
◆ encrypt_block() [2/2]
template<std::size_t BlockBits>
|
inlinestaticprotected |
◆ prepare_schedule()
template<std::size_t BlockBits>
|
inlinestaticprotected |
Member Data Documentation
◆ block_bits
template<std::size_t BlockBits>
|
staticconstexpr |
◆ block_words
template<std::size_t BlockBits>
|
staticconstexpr |
◆ key_bits
template<std::size_t BlockBits>
|
staticconstexpr |
◆ key_words
template<std::size_t BlockBits>
|
staticconstexpr |
◆ rounds
template<std::size_t BlockBits>
|
static |
◆ schedule
template<std::size_t BlockBits>
|
protected |
◆ version
template<std::size_t BlockBits>
|
staticconstexpr |
◆ word_bits
template<std::size_t BlockBits>
|
staticconstexpr |
The documentation for this class was generated from the following file: