Public Member Functions | Private Member Functions | Private Attributes

SHA256Context Class Reference

Inherits Encryption::Context.

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

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 block, digest, h, len, sha256_h0, and tot_len.


Member Function Documentation

void SHA256Context::Finalize (  )  [inline, virtual]

Implements Encryption::Context.

Definition at line 198 of file enc_sha256.cpp.

References block, digest, h, len, SHA256_BLOCK_SIZE, tot_len, Transform(), and UNPACK32().

Referenced by ESHA256::OnEncrypt().

Encryption::Hash SHA256Context::GetFinalizedHash (  )  [inline, virtual]

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 
) [inline, private]

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 
) [inline, virtual]

Implements Encryption::Context.

Definition at line 176 of file enc_sha256.cpp.

References block, len, SHA256_BLOCK_SIZE, tot_len, 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.

Referenced by Finalize(), SHA256Context(), and Update().

unsigned char SHA256Context::digest[SHA256_DIGEST_SIZE] [private]

Definition at line 154 of file enc_sha256.cpp.

Referenced by Finalize(), GetFinalizedHash(), and SHA256Context().

uint32_t SHA256Context::h[8] [private]

Definition at line 153 of file enc_sha256.cpp.

Referenced by Finalize(), SHA256Context(), and Transform().

unsigned SHA256Context::len [private]

Definition at line 151 of file enc_sha256.cpp.

Referenced by Finalize(), SHA256Context(), and Update().

unsigned SHA256Context::tot_len [private]

Definition at line 150 of file enc_sha256.cpp.

Referenced by Finalize(), SHA256Context(), and Update().


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