Anope IRC Services  Version 2.0
Public Member Functions | Private Member Functions | Private Attributes
SHA256Context Class Reference
Inheritance diagram for SHA256Context:
Inheritance graph
[legend]
Collaboration diagram for SHA256Context:
Collaboration graph
[legend]

Public Member Functions

 SHA256Context (Encryption::IV *iv)
 
void Update (const unsigned char *message, size_t mlen) anope_override
 
void Finalize () anope_override
 
Encryption::Hash GetFinalizedHash () anope_override
 
- Public Member Functions inherited from Encryption::Context
virtual ~Context ()
 

Private Member Functions

void Transform (unsigned char *message, unsigned block_nb)
 

Private Attributes

unsigned tot_len
 
unsigned len
 
unsigned char block [2 *SHA256_BLOCK_SIZE]
 
uint32_t h [8]
 
unsigned char digest [SHA256_DIGEST_SIZE]
 

Detailed Description

An sha256 context

Definition at line 115 of file enc_sha256.cpp.

Constructor & Destructor Documentation

SHA256Context::SHA256Context ( Encryption::IV iv)
inline

Definition at line 157 of file enc_sha256.cpp.

References sha256_h0.

Member Function Documentation

void SHA256Context::Finalize ( )
inlinevirtual

Implements Encryption::Context.

Definition at line 198 of file enc_sha256.cpp.

References len, SHA256_BLOCK_SIZE, Transform(), and UNPACK32().

Referenced by ESHA256::OnEncrypt().

Encryption::Hash SHA256Context::GetFinalizedHash ( )
inlinevirtual

Implements Encryption::Context.

Definition at line 211 of file enc_sha256.cpp.

References digest, and SHA256_DIGEST_SIZE.

Referenced by ESHA256::OnEncrypt().

void SHA256Context::Transform ( unsigned char *  message,
unsigned  block_nb 
)
inlineprivate

Definition at line 117 of file enc_sha256.cpp.

References CH(), h, MAJ(), PACK32(), SHA256_F1(), SHA256_F2(), sha256_k, and SHA256_SCR().

Referenced by Finalize(), and Update().

void SHA256Context::Update ( const unsigned char *  message,
size_t  mlen 
)
inlinevirtual

Implements Encryption::Context.

Definition at line 176 of file enc_sha256.cpp.

References len, SHA256_BLOCK_SIZE, and Transform().

Referenced by ESHA256::OnEncrypt().

Field Documentation

unsigned char SHA256Context::block[2 *SHA256_BLOCK_SIZE]
private

Definition at line 152 of file enc_sha256.cpp.

unsigned char SHA256Context::digest[SHA256_DIGEST_SIZE]
private

Definition at line 154 of file enc_sha256.cpp.

Referenced by GetFinalizedHash().

uint32_t SHA256Context::h[8]
private

Definition at line 153 of file enc_sha256.cpp.

Referenced by Transform().

unsigned SHA256Context::len
private

Definition at line 151 of file enc_sha256.cpp.

Referenced by Finalize(), and Update().

unsigned SHA256Context::tot_len
private

Definition at line 150 of file enc_sha256.cpp.


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