#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

◆ schedule_type

◆ word_type

Constructor & Destructor Documentation

◆ basic_shacal()

nil::crypto3::block::basic_shacal::basic_shacal ( const schedule_type s)

◆ ~basic_shacal()

virtual nil::crypto3::block::basic_shacal::~basic_shacal ( )

Member Function Documentation

◆ decrypt()

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

◆ encrypt()

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

Member Data Documentation

◆ block_bits

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

◆ block_words

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

◆ key_bits

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

◆ key_words

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

◆ rounds

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

◆ word_bits

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

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