Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | HKDFContext |
struct | HMACContext |
struct | SHA1Context |
struct | SHA256Context |
struct | SHA512Context |
struct | USHAContext |
Macros | |
#define | _SHA_enum_ |
#define | SHA_Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) |
#define | SHA_Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
#define | SHA_Parity(x, y, z) ((x) ^ (y) ^ (z)) |
Typedefs | |
typedef struct HKDFContext | HKDFContext |
typedef struct HMACContext | HMACContext |
typedef struct SHA1Context | SHA1Context |
typedef struct SHA256Context | SHA224Context |
typedef struct SHA256Context | SHA256Context |
typedef struct SHA512Context | SHA384Context |
typedef struct SHA512Context | SHA512Context |
typedef enum SHAversion | SHAversion |
typedef struct USHAContext | USHAContext |
Enumerations | |
enum | { shaSuccess = 0 , shaNull , shaInputTooLong , shaStateError , shaBadParam } |
enum | { SHA1_Message_Block_Size = 64 , SHA224_Message_Block_Size = 64 , SHA256_Message_Block_Size = 64 , SHA384_Message_Block_Size = 128 , SHA512_Message_Block_Size = 128 , USHA_Max_Message_Block_Size = SHA512_Message_Block_Size , SHA1HashSize = 20 , SHA224HashSize = 28 , SHA256HashSize = 32 , SHA384HashSize = 48 , SHA512HashSize = 64 , USHAMaxHashSize = SHA512HashSize , SHA1HashSizeBits = 160 , SHA224HashSizeBits = 224 , SHA256HashSizeBits = 256 , SHA384HashSizeBits = 384 , SHA512HashSizeBits = 512 , USHAMaxHashSizeBits = SHA512HashSizeBits } |
enum | SHAversion { SHA1 , SHA224 , SHA256 , SHA384 , SHA512 } |
Functions | |
int | SHA1FinalBits (SHA1Context *, uint8_t bits, unsigned int bit_count) |
SHA1FinalBits Add in any final bits of the message. More... | |
int | SHA1Input (SHA1Context *, const uint8_t *bytes, unsigned int bytecount) |
int | SHA1Reset (SHA1Context *) |
SHA1Reset. More... | |
int | SHA1Result (SHA1Context *, uint8_t Message_Digest[SHA1HashSize]) |
SHA1Result Returns the resulting 160-bit digest. More... | |
int | SHA224FinalBits (SHA224Context *, uint8_t bits, unsigned int bit_count) |
int | SHA224Input (SHA224Context *, const uint8_t *bytes, unsigned int bytecount) |
int | SHA224Reset (SHA224Context *) |
int | SHA224Result (SHA224Context *, uint8_t Message_Digest[SHA224HashSize]) |
int | SHA256FinalBits (SHA256Context *, uint8_t bits, unsigned int bit_count) |
int | SHA256Input (SHA256Context *, const uint8_t *bytes, unsigned int bytecount) |
int | SHA256Reset (SHA256Context *) |
int | SHA256Result (SHA256Context *, uint8_t Message_Digest[SHA256HashSize]) |
int | SHA384FinalBits (SHA384Context *, uint8_t bits, unsigned int bit_count) |
int | SHA384Input (SHA384Context *, const uint8_t *bytes, unsigned int bytecount) |
int | SHA384Reset (SHA384Context *) |
int | SHA384Result (SHA384Context *, uint8_t Message_Digest[SHA384HashSize]) |
int | SHA512FinalBits (SHA512Context *, uint8_t bits, unsigned int bit_count) |
int | SHA512Input (SHA512Context *, const uint8_t *bytes, unsigned int bytecount) |
int | SHA512Reset (SHA512Context *) |
int | SHA512Result (SHA512Context *, uint8_t Message_Digest[SHA512HashSize]) |
int | USHABlockSize (enum SHAversion whichSha) |
int | USHAFinalBits (USHAContext *context, uint8_t bits, unsigned int bit_count) |
const char * | USHAHashName (enum SHAversion whichSha) |
int | USHAHashSize (enum SHAversion whichSha) |
int | USHAHashSizeBits (enum SHAversion whichSha) |
int | USHAInput (USHAContext *context, const uint8_t *bytes, unsigned int bytecount) |
int | USHAReset (USHAContext *context, SHAversion whichSha) |
int | USHAResult (USHAContext *context, uint8_t Message_Digest[USHAMaxHashSize]) |
#define SHA_Maj | ( | x, | |
y, | |||
z | |||
) | (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
typedef struct HKDFContext HKDFContext |
typedef struct HMACContext HMACContext |
typedef struct SHA1Context SHA1Context |
typedef struct SHA256Context SHA224Context |
typedef struct SHA256Context SHA256Context |
typedef struct SHA512Context SHA384Context |
typedef struct SHA512Context SHA512Context |
typedef enum SHAversion SHAversion |
typedef struct USHAContext USHAContext |
anonymous enum |
Enumerator | |
---|---|
shaSuccess | |
shaNull | |
shaInputTooLong | |
shaStateError | |
shaBadParam |
anonymous enum |
enum SHAversion |
Enumerator | |
---|---|
SHA1 | |
SHA224 | |
SHA256 | |
SHA384 | |
SHA512 |
Definition at line 121 of file sha1.h.
int SHA1FinalBits | ( | SHA1Context * | context, |
uint8_t | message_bits, | ||
unsigned int | length | ||
) |
SHA1FinalBits Add in any final bits of the message.
[in,out] | context | The SHA context to update. |
[in] | message_bits | The final bits of the message, in the upper portion of the byte. (Use 0b###00000 instead of 0b00000### to input the three bits ###.) |
[in] | length | The number of bits in message_bits, between 1 and 7. |
Definition at line 179 of file sha1.c.
References voicemailpwcheck::context, SHA1AddLength, SHA1Finalize(), shaBadParam, shaNull, shaStateError, and shaSuccess.
int SHA1Input | ( | SHA1Context * | , |
const uint8_t * | bytes, | ||
unsigned int | bytecount | ||
) |
Referenced by ast_sha1_hash(), and ast_sha1_hash_uint().
int SHA1Reset | ( | SHA1Context * | context | ) |
SHA1Reset.
context | the context to be reset. This function will initialize the SHA1Context in preparation for computing a new SHA1 message digest. |
Definition at line 101 of file sha1.c.
References voicemailpwcheck::context, shaNull, and shaSuccess.
Referenced by ast_sha1_hash(), and ast_sha1_hash_uint().
int SHA1Result | ( | SHA1Context * | context, |
uint8_t | Message_Digest[SHA1HashSize] | ||
) |
SHA1Result Returns the resulting 160-bit digest.
[in,out] | context | The SHA context to update. |
[out] | Message_Digest | Where the digest is returned. |
This function will return the 160-bit message digest into the Message_Digest array provided by the caller.
Definition at line 226 of file sha1.c.
References voicemailpwcheck::context, SHA1Finalize(), SHA1HashSize, shaNull, and shaSuccess.
Referenced by ast_sha1_hash(), and ast_sha1_hash_uint().
int SHA224FinalBits | ( | SHA224Context * | , |
uint8_t | bits, | ||
unsigned int | bit_count | ||
) |
int SHA224Input | ( | SHA224Context * | , |
const uint8_t * | bytes, | ||
unsigned int | bytecount | ||
) |
int SHA224Reset | ( | SHA224Context * | ) |
int SHA224Result | ( | SHA224Context * | , |
uint8_t | Message_Digest[SHA224HashSize] | ||
) |
int SHA256FinalBits | ( | SHA256Context * | , |
uint8_t | bits, | ||
unsigned int | bit_count | ||
) |
int SHA256Input | ( | SHA256Context * | , |
const uint8_t * | bytes, | ||
unsigned int | bytecount | ||
) |
int SHA256Reset | ( | SHA256Context * | ) |
int SHA256Result | ( | SHA256Context * | , |
uint8_t | Message_Digest[SHA256HashSize] | ||
) |
int SHA384FinalBits | ( | SHA384Context * | , |
uint8_t | bits, | ||
unsigned int | bit_count | ||
) |
int SHA384Input | ( | SHA384Context * | , |
const uint8_t * | bytes, | ||
unsigned int | bytecount | ||
) |
int SHA384Reset | ( | SHA384Context * | ) |
int SHA384Result | ( | SHA384Context * | , |
uint8_t | Message_Digest[SHA384HashSize] | ||
) |
int SHA512FinalBits | ( | SHA512Context * | , |
uint8_t | bits, | ||
unsigned int | bit_count | ||
) |
int SHA512Input | ( | SHA512Context * | , |
const uint8_t * | bytes, | ||
unsigned int | bytecount | ||
) |
int SHA512Reset | ( | SHA512Context * | ) |
int SHA512Result | ( | SHA512Context * | , |
uint8_t | Message_Digest[SHA512HashSize] | ||
) |
int USHABlockSize | ( | enum SHAversion | whichSha | ) |
int USHAFinalBits | ( | USHAContext * | context, |
uint8_t | bits, | ||
unsigned int | bit_count | ||
) |
const char * USHAHashName | ( | enum SHAversion | whichSha | ) |
int USHAHashSize | ( | enum SHAversion | whichSha | ) |
int USHAHashSizeBits | ( | enum SHAversion | whichSha | ) |
int USHAInput | ( | USHAContext * | context, |
const uint8_t * | bytes, | ||
unsigned int | bytecount | ||
) |
int USHAReset | ( | USHAContext * | context, |
SHAversion | whichSha | ||
) |
int USHAResult | ( | USHAContext * | context, |
uint8_t | Message_Digest[USHAMaxHashSize] | ||
) |