plebble
us::gov::crypto::sha256 Class Reference

#include <sha256.h>

Collaboration diagram for us::gov::crypto::sha256:

Classes

class  hash_t
 
struct  value_type
 

Public Member Functions

 sha256 ()
 
void write (const unsigned char *data, size_t len)
 
void write (const vector< unsigned char > &)
 
void write (const string &data)
 
void write (const ripemd160::value_type &data)
 
void finalize (unsigned char hash[output_size])
 
void finalize (value_type &)
 
void reset ()
 

Static Public Member Functions

static hash_t hash (String text)
 
static hash_t hash (byte[] text)
 

Static Public Attributes

static constexpr uint32_t output_size = 32
 

Private Member Functions

void initialize (uint32_t *s)
 
uint32_t Ch (uint32_t x, uint32_t y, uint32_t z)
 
uint32_t Maj (uint32_t x, uint32_t y, uint32_t z)
 
uint32_t Sigma0 (uint32_t x)
 
uint32_t Sigma1 (uint32_t x)
 
uint32_t sigma0 (uint32_t x)
 
uint32_t sigma1 (uint32_t x)
 
void Round (uint32_t a, uint32_t b, uint32_t c, uint32_t &d, uint32_t e, uint32_t f, uint32_t g, uint32_t &h, uint32_t k, uint32_t w)
 
void transform (uint32_t *s, const unsigned char *chunk)
 
 sha256 ()
 

Private Attributes

uint32_t s [8]
 
unsigned char buf [64]
 
uint64_t bytes
 

Constructor & Destructor Documentation

◆ sha256() [1/2]

us::gov::crypto::sha256::sha256 ( )

◆ sha256() [2/2]

us.gov.crypto.sha256.sha256 ( )
inlineprivate

Member Function Documentation

◆ Ch()

uint32_t us::gov::crypto::sha256::Ch ( uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlineprivate

◆ finalize() [1/2]

void us::gov::crypto::sha256::finalize ( unsigned char  hash[output_size])

◆ finalize() [2/2]

void us::gov::crypto::sha256::finalize ( value_type )

◆ hash() [1/2]

static hash_t us.gov.crypto.sha256.hash ( byte[]  text)
inlinestatic

◆ hash() [2/2]

static hash_t us.gov.crypto.sha256.hash ( String  text)
inlinestatic

Referenced by main.create_instance_H(), and us::gov::crypto::ec.generate_shared_key().

Here is the caller graph for this function:

◆ initialize()

void us::gov::crypto::sha256::initialize ( uint32_t *  s)
private

◆ Maj()

uint32_t us::gov::crypto::sha256::Maj ( uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlineprivate

◆ reset()

void us::gov::crypto::sha256::reset ( )

◆ Round()

void us::gov::crypto::sha256::Round ( uint32_t  a,
uint32_t  b,
uint32_t  c,
uint32_t &  d,
uint32_t  e,
uint32_t  f,
uint32_t  g,
uint32_t &  h,
uint32_t  k,
uint32_t  w 
)
inlineprivate

◆ Sigma0()

uint32_t us::gov::crypto::sha256::Sigma0 ( uint32_t  x)
inlineprivate

◆ sigma0()

uint32_t us::gov::crypto::sha256::sigma0 ( uint32_t  x)
inlineprivate

◆ Sigma1()

uint32_t us::gov::crypto::sha256::Sigma1 ( uint32_t  x)
inlineprivate

◆ sigma1()

uint32_t us::gov::crypto::sha256::sigma1 ( uint32_t  x)
inlineprivate

◆ transform()

void us::gov::crypto::sha256::transform ( uint32_t *  s,
const unsigned char *  chunk 
)
private

◆ write() [1/4]

void us::gov::crypto::sha256::write ( const ripemd160::value_type data)

◆ write() [2/4]

void us::gov::crypto::sha256::write ( const string &  data)

◆ write() [3/4]

void us::gov::crypto::sha256::write ( const unsigned char *  data,
size_t  len 
)

Referenced by us::gov::engine::local_deltas::hash_data_to_sign().

Here is the caller graph for this function:

◆ write() [4/4]

void us::gov::crypto::sha256::write ( const vector< unsigned char > &  )

Member Data Documentation

◆ buf

unsigned char us::gov::crypto::sha256::buf[64]
private

◆ bytes

uint64_t us::gov::crypto::sha256::bytes
private

◆ output_size

constexpr uint32_t us::gov::crypto::sha256::output_size = 32
staticconstexpr

◆ s

uint32_t us::gov::crypto::sha256::s[8]
private

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