Adobe Source Libraries  1.43
Classes | Typedefs | Functions
SHA (Secure Hash Algorithm)

Classes

class  sha< Traits >
 

Typedefs

typedef traits_type::digest_type digest_type
 
typedef sha
< implementation::sha1_traits_t > 
sha1_t
 A bit-oriented implementation of the SHA-1 Secure Hash Algorithm. More...
 
typedef sha
< implementation::sha224_traits_t > 
sha224_t
 A bit-oriented implementation of the SHA-224 Secure Hash Algorithm. More...
 
typedef sha
< implementation::sha256_traits_t > 
sha256_t
 A bit-oriented implementation of the SHA-256 Secure Hash Algorithm. More...
 
typedef sha
< implementation::sha384_traits_t > 
sha384_t
 A bit-oriented implementation of the SHA-384 Secure Hash Algorithm. More...
 
typedef sha
< implementation::sha512_traits_t > 
sha512_t
 A bit-oriented implementation of the SHA-512 Secure Hash Algorithm. More...
 

Functions

 sha ()
 
template<typename I >
void update (I first, I last)
 
template<typename I >
void update (I first, std::uint64_t num_bits)
 
digest_type finalize ()
 
template<typename I >
static digest_type digest (I first, I last)
 
template<typename I >
static digest_type digest (I first, std::uint64_t num_bits)
 

Detailed Description

Typedef Documentation

typedef traits_type::digest_type digest_type

A statically-sized, contiguous array for the resulting SHA-* digest.

Note
the size of this digest will change depending on the SHA routine in use.

Definition at line 771 of file sha.hpp.

typedef sha<implementation::sha1_traits_t> sha1_t

A bit-oriented implementation of the SHA-1 Secure Hash Algorithm.

Definition at line 959 of file sha.hpp.

typedef sha<implementation::sha224_traits_t> sha224_t

A bit-oriented implementation of the SHA-224 Secure Hash Algorithm.

Definition at line 967 of file sha.hpp.

typedef sha<implementation::sha256_traits_t> sha256_t

A bit-oriented implementation of the SHA-256 Secure Hash Algorithm.

Definition at line 975 of file sha.hpp.

typedef sha<implementation::sha384_traits_t> sha384_t

A bit-oriented implementation of the SHA-384 Secure Hash Algorithm.

Definition at line 983 of file sha.hpp.

typedef sha<implementation::sha512_traits_t> sha512_t

A bit-oriented implementation of the SHA-512 Secure Hash Algorithm.

Definition at line 991 of file sha.hpp.

Function Documentation

sha ( )

Sets the state of the digest machine to its default.

Definition at line 778 of file sha.hpp.

void update ( first,
last 
)

This routine can be called successively to digest a data over one or more steps.

Precondition
sizeof(std::iterator_traits<I>::value_type) must be 1
Parameters
firstfirst iterator over the range to digest
lastlast iterator over the range to digest
Note
While the SHA standard specifies the ability to process messages up to 2^128 bits, this routine is limited to sizeof(std::iterator_traits<I>::difference_type) * 8 bits. A workaround to the limitation is to call this routine multiple times. Even then, the total message length is limited to 2^64 bits.

Definition at line 801 of file sha.hpp.

void update ( first,
std::uint64_t  num_bits 
)

This routine can be called successively to digest a data over one or more steps.

Precondition
sizeof(std::iterator_traits<I>::value_type) must be 1
Parameters
firstfirst iterator over the range to digest
num_bitsnumber of bits to digest
Note
While the SHA standard specifies the ability to process messages up to 2^128 bits, this routine is limited to messages of 2^64 bits in length.
If update is called multiple times all but the last call must have num_bits % 8 == 0

Definition at line 829 of file sha.hpp.

digest_type finalize ( )
Returns
The SHA-* digest of the message

Definition at line 843 of file sha.hpp.

static digest_type digest ( first,
last 
)
static
Precondition
sizeof(std::iterator_traits<I>::value_type) must be 1
Parameters
firstfirst iterator over the range to digest
lastlast iterator over the range to digest
Note
While the SHA standard specifies the ability to process messages up to 2^128 bits, this routine is limited to sizeof(std::iterator_traits<I>::difference_type) * 8 bits.
Returns
The SHA-* digest of the message

Definition at line 869 of file sha.hpp.

static digest_type digest ( first,
std::uint64_t  num_bits 
)
static
Precondition
sizeof(std::iterator_traits<I>::value_type) must be 1
Parameters
firstfirst iterator over the range to digest
num_bitsnumber of bits to digest
Note
While the SHA standard specifies the ability to process messages up to 2^128 bits, this routine is limited to messages of 2^64 bits in length.
Returns
The SHA-* digest of the message

Definition at line 892 of file sha.hpp.