Shacal. Merkle-Damgård construction foundation for SHA hashes. More...

#include <shacal.hpp>

+ Inheritance diagram for nil::crypto3::block::shacal:
+ Collaboration diagram for nil::crypto3::block::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
 
 shacal (const key_type &k)
 
 shacal (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
 
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
 

Detailed Description

Shacal. Merkle-Damgård construction foundation for SHA hashes.

Implemented directly from the SHA standard as found at http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf

The original FIPS-180 seems to be gone, but FIPS 180-1 (http://www.itl.nist.gov/fipspubs/fip180-1.htm) says the onl in SHA-1 from SHA(-0) is the rotation in the key scheduling.

In SHA terminology:

  • plaintext = H^(i-1)
  • ciphertext = H^(i)
  • key = M^(i)
  • schedule = W

Member Typedef Documentation

◆ block_type

◆ key_type

◆ policy_type

◆ schedule_type

◆ word_type

Constructor & Destructor Documentation

◆ shacal() [1/2]

nil::crypto3::block::shacal::shacal ( const key_type k)
inline

◆ shacal() [2/2]

nil::crypto3::block::shacal::shacal ( schedule_type  s)
inline

Member Function Documentation

◆ decrypt()

block_type nil::crypto3::block::basic_shacal::decrypt ( const block_type ciphertext) const
inlineinherited

◆ encrypt()

block_type nil::crypto3::block::basic_shacal::encrypt ( const block_type plaintext) const
inlineinherited

Member Data Documentation

◆ block_bits

constexpr static const std::size_t nil::crypto3::block::basic_shacal::block_bits = policy_type::block_bits
staticconstexprinherited

◆ block_words

constexpr static const std::size_t nil::crypto3::block::basic_shacal::block_words = policy_type::block_words
staticconstexprinherited

◆ key_bits

constexpr static const std::size_t nil::crypto3::block::basic_shacal::key_bits = policy_type::key_bits
staticconstexprinherited

◆ key_words

constexpr static const std::size_t nil::crypto3::block::basic_shacal::key_words = policy_type::key_words
staticconstexprinherited

◆ rounds

constexpr static const std::size_t nil::crypto3::block::basic_shacal::rounds = policy_type::rounds
staticconstexprinherited

◆ word_bits

constexpr static const std::size_t nil::crypto3::block::basic_shacal::word_bits = policy_type::word_bits
staticconstexprinherited

The documentation for this class was generated from the following file: