sha2.h File Reference
`#include <sys/types.h>`

Go to the source code of this file.

## Data Structures

struct | _SHA256_CTX
struct | _SHA512_CTX

## Macros

#define | SHA256_BLOCK_LENGTH 64
#define | SHA256_DIGEST_LENGTH 32
#define | SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
#define | SHA384_BLOCK_LENGTH 128
#define | SHA384_DIGEST_LENGTH 48
#define | SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1)
#define | SHA512_BLOCK_LENGTH 128
#define | SHA512_DIGEST_LENGTH 64
#define | SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)

## Typedefs

typedef unsigned char | uint8_t
typedef unsigned int | uint32_t
typedef unsigned long long | uint64_t
typedef struct _SHA256_CTX | SHA256_CTX
typedef struct _SHA512_CTX | SHA512_CTX
typedef SHA512_CTX | SHA384_CTX

## Functions

void | SHA256_Init (SHA256_CTX *)
void | SHA256_Update (SHA256_CTX *, const uint8_t *, size_t)
void | SHA256_Final (uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX *)
char * | SHA256_End (SHA256_CTX *, char[SHA256_DIGEST_STRING_LENGTH])
char * | SHA256_Data (const uint8_t *, size_t, char[SHA256_DIGEST_STRING_LENGTH])
void | SHA384_Init (SHA384_CTX *)
void | SHA384_Update (SHA384_CTX *, const uint8_t *, size_t)
void | SHA384_Final (uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX *)
char * | SHA384_End (SHA384_CTX *, char[SHA384_DIGEST_STRING_LENGTH])
char * | SHA384_Data (const uint8_t *, size_t, char[SHA384_DIGEST_STRING_LENGTH])
void | SHA512_Init (SHA512_CTX *)
void | SHA512_Update (SHA512_CTX *, const uint8_t *, size_t)
void | SHA512_Final (uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX *)
char * | SHA512_End (SHA512_CTX *, char[SHA512_DIGEST_STRING_LENGTH])
char * | SHA512_Data (const uint8_t *, size_t, char[SHA512_DIGEST_STRING_LENGTH])

## Macro Definition Documentation

#define SHA256_BLOCK_LENGTH 64

Definition at line 78 of file sha2.h.

Referenced by SHA256_Final(), SHA256_Init(), and SHA256_Update().

#define SHA256_DIGEST_LENGTH 32

Definition at line 79 of file sha2.h.

Referenced by SHA256_End(), SHA256_Final(), and SHA256_Init().

#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)

Definition at line 80 of file sha2.h.

#define SHA384_BLOCK_LENGTH 128

Definition at line 81 of file sha2.h.

Referenced by SHA384_Init().

#define SHA384_DIGEST_LENGTH 48

Definition at line 82 of file sha2.h.

Referenced by SHA384_End(), and SHA384_Final().

#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1)

Definition at line 83 of file sha2.h.

#define SHA512_BLOCK_LENGTH 128

Definition at line 84 of file sha2.h.

Referenced by SHA512_Init(), SHA512_Last(), and SHA512_Update().

#define SHA512_DIGEST_LENGTH 64

Definition at line 85 of file sha2.h.

Referenced by SHA384_Init(), SHA512_End(), SHA512_Final(), and SHA512_Init().

#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)

Definition at line 86 of file sha2.h.

## Typedef Documentation

typedef struct _SHA256_CTX SHA256_CTX

typedef SHA512_CTX SHA384_CTX

Definition at line 133 of file sha2.h.

typedef struct _SHA512_CTX SHA512_CTX

typedef unsigned int uint32_t

Definition at line 101 of file sha2.h.

typedef unsigned long long uint64_t

Definition at line 102 of file sha2.h.

typedef unsigned char uint8_t

Definition at line 100 of file sha2.h.

## Function Documentation

char* SHA256_Data | ( | const uint8_t * | ,
|  | size_t | ,
|  | char | [SHA256_DIGEST_STRING_LENGTH]
| ) |  |

char* SHA256_End | ( | SHA256_CTX * | ,
|  | char | [SHA256_DIGEST_STRING_LENGTH]
| ) |  |

void SHA256_Final | ( | uint8_t | [SHA256_DIGEST_LENGTH],
|  | SHA256_CTX * |
| ) |  |

void SHA256_Init | ( | SHA256_CTX * |  | ) |

Definition at line 344 of file sha2.c.

References _SHA256_CTX::bitcount, _SHA256_CTX::buffer, MEMCPY_BCOPY, MEMSET_BZERO, SHA256_BLOCK_LENGTH, SHA256_DIGEST_LENGTH, sha256_initial_hash_value, and _SHA256_CTX::state.

Referenced by SHA256_Data().

void SHA256_Update | ( | SHA256_CTX * | ,
|  | const uint8_t * | ,
|  | size_t |
| ) |  |

char* SHA384_Data | ( | const uint8_t * | ,
|  | size_t | ,
|  | char | [SHA384_DIGEST_STRING_LENGTH]
| ) |  |

char* SHA384_End | ( | SHA384_CTX * | ,
|  | char | [SHA384_DIGEST_STRING_LENGTH]
| ) |  |

void SHA384_Final | ( | uint8_t | [SHA384_DIGEST_LENGTH],
|  | SHA384_CTX * |
| ) |  |

void SHA384_Init | ( | SHA384_CTX * |  | ) |

Definition at line 1001 of file sha2.c.

References _SHA512_CTX::bitcount, _SHA512_CTX::buffer, MEMCPY_BCOPY, MEMSET_BZERO, SHA384_BLOCK_LENGTH, sha384_initial_hash_value, SHA512_DIGEST_LENGTH, and _SHA512_CTX::state.

Referenced by SHA384_Data().

void SHA384_Update | ( | SHA384_CTX * | ,
|  | const uint8_t * | ,
|  | size_t |
| ) |  |

char* SHA512_Data | ( | const uint8_t * | ,
|  | size_t | ,
|  | char | [SHA512_DIGEST_STRING_LENGTH]
| ) |  |

char* SHA512_End | ( | SHA512_CTX * | ,
|  | char | [SHA512_DIGEST_STRING_LENGTH]
| ) |  |

void SHA512_Final | ( | uint8_t | [SHA512_DIGEST_LENGTH],
|  | SHA512_CTX * |
| ) |  |

void SHA512_Init | ( | SHA512_CTX * |  | ) |

Definition at line 672 of file sha2.c.

References _SHA512_CTX::bitcount, _SHA512_CTX::buffer, MEMCPY_BCOPY, MEMSET_BZERO, SHA512_BLOCK_LENGTH, SHA512_DIGEST_LENGTH, sha512_initial_hash_value, and _SHA512_CTX::state.

Referenced by SHA512_Data().

void SHA512_Update | ( | SHA512_CTX * | ,
|  | const uint8_t * | ,
|  | size_t |
| ) |  |