plebble
us::gov::crypto::ripemd160 Class Reference

#include <ripemd160.h>

Collaboration diagram for us::gov::crypto::ripemd160:

Classes

class  hash_t
 
struct  value_type
 

Public Member Functions

 ripemd160 ()
 
void write (const vector< unsigned char > &)
 
void write (const unsigned char *data, size_t len)
 
void write (const value_type &)
 
void write (const string &)
 
void write (const uint64_t &)
 
void write (const int64_t &)
 
void write (const uint32_t &)
 
void write (const int32_t &)
 
void write (bool)
 
void write (const double &)
 
void finalize (unsigned char hash[output_size])
 
void finalize (value_type &)
 
void reset ()
 

Static Public Member Functions

static pair< ko, value_typedigest_file (const string &file)
 
static value_type digest (const vector< unsigned char > &buf)
 
static hash_t hash (byte[] msg)
 

Static Public Attributes

static constexpr size_t output_size = 20
 

Private Member Functions

 ripemd160 ()
 

Static Private Member Functions

static void compress (int[] state, byte[] blocks, int len)
 
static int f (int i, int x, int y, int z)
 

Private Attributes

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

Static Private Attributes

static const unsigned char pad [64]
 
static final int BLOCK_LEN = 64
 
static final int[] KL = {0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E}
 
static final int[] KR = {0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000}
 
static final int[] RL
 
static final int[] RR
 
static final int[] SL
 
static final int[] SR
 

Constructor & Destructor Documentation

◆ ripemd160() [1/2]

us::gov::crypto::ripemd160::ripemd160 ( )

◆ ripemd160() [2/2]

us.gov.crypto.ripemd160.ripemd160 ( )
inlineprivate

Member Function Documentation

◆ compress()

static void us.gov.crypto.ripemd160.compress ( int[]  state,
byte[]  blocks,
int  len 
)
inlinestaticprivate

References BLOCK_LEN, f(), KL, KR, RL, RR, SL, and SR.

Referenced by hash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ digest()

static value_type us::gov::crypto::ripemd160::digest ( const vector< unsigned char > &  buf)
static

◆ digest_file()

static pair<ko, value_type> us::gov::crypto::ripemd160::digest_file ( const string &  file)
static

◆ f()

static int us.gov.crypto.ripemd160.f ( int  i,
int  x,
int  y,
int  z 
)
inlinestaticprivate

Referenced by compress().

Here is the caller graph for this function:

◆ finalize() [1/2]

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

Referenced by us::gov::crypto::ripemd160::value_type::compute(), and us::gov::crypto::ec::keys::pub_t::compute_hash().

Here is the caller graph for this function:

◆ finalize() [2/2]

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

◆ hash()

static hash_t us.gov.crypto.ripemd160.hash ( byte[]  msg)
inlinestatic

Computes and returns a 20-byte (160-bit) hash of the specified binary message. Each call will return a new byte array object instance.

Parameters
msgthe message to compute the hash of
Returns
a 20-byte array representing the message's RIPEMD-160 hash
Exceptions
NullPointerExceptionif the message is
null

References BLOCK_LEN, compress(), and us.gov.crypto.ripemd160.hash_t.value.

Referenced by us::gov::socket::datagram.compute_hash(), us::gov::socket::datagram.compute_hash_payload(), and main.create_instance_h().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

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

◆ write() [1/10]

void us::gov::crypto::ripemd160::write ( bool  )

◆ write() [2/10]

void us::gov::crypto::ripemd160::write ( const double &  )

◆ write() [3/10]

void us::gov::crypto::ripemd160::write ( const int32_t &  )

◆ write() [4/10]

void us::gov::crypto::ripemd160::write ( const int64_t &  )

◆ write() [5/10]

void us::gov::crypto::ripemd160::write ( const string &  )

◆ write() [6/10]

void us::gov::crypto::ripemd160::write ( const uint32_t &  )

◆ write() [7/10]

void us::gov::crypto::ripemd160::write ( const uint64_t &  )

◆ write() [8/10]

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

◆ write() [9/10]

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

◆ write() [10/10]

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

Member Data Documentation

◆ BLOCK_LEN

final int us.gov.crypto.ripemd160.BLOCK_LEN = 64
staticprivate

Referenced by compress(), and hash().

◆ buf

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

◆ bytes

uint64_t us::gov::crypto::ripemd160::bytes
private

◆ KL

final int [] us.gov.crypto.ripemd160.KL = {0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E}
staticprivate

Referenced by compress().

◆ KR

final int [] us.gov.crypto.ripemd160.KR = {0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000}
staticprivate

Referenced by compress().

◆ output_size

constexpr size_t us::gov::crypto::ripemd160::output_size = 20
staticconstexpr

◆ pad

const unsigned char us::gov::crypto::ripemd160::pad[64]
staticprivate

◆ RL

final int [] us.gov.crypto.ripemd160.RL
staticprivate
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13}

Referenced by compress().

◆ RR

final int [] us.gov.crypto.ripemd160.RR
staticprivate
Initial value:
= {
5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11}

Referenced by compress().

◆ s

uint32_t us::gov::crypto::ripemd160::s[5]
private

◆ SL

final int [] us.gov.crypto.ripemd160.SL
staticprivate
Initial value:
= {
11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6}

Referenced by compress().

◆ SR

final int [] us.gov.crypto.ripemd160.SR
staticprivate
Initial value:
= {
8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11}

Referenced by compress().


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