Common definitions for the SHA-224/256 hash functions. More...
Common definitions for the SHA-224/256 hash functions.
Definition in file sha2xx_common.h.
#include <string.h>#include <stdint.h>
Include dependency graph for sha2xx_common.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | sha2xx_context_t |
| Structure to hold the SHA-2XX context. More... | |
Functions | |
| void | sha2xx_pad (sha2xx_context_t *ctx) |
| SHA-2XX initialization. More... | |
| void | sha2xx_update (sha2xx_context_t *ctx, const void *data, size_t len) |
| Add bytes into the hash. More... | |
| void | sha2xx_final (sha2xx_context_t *ctx, void *digest, size_t dig_len) |
| SHA-2XX finalization. More... | |
Variables | |
| static const uint32_t | K [64] |
| SHA-224 and SHA-256 Constants. More... | |
| #define | Ch(x, y, z) ((x & (y ^ z)) ^ z) |
| Elementary functions used by SHA2XX. | |
| #define | Maj(x, y, z) ((x & (y | z)) | (y & z)) |
| #define | SHR(x, n) (x >> n) |
| #define | ROTR(x, n) ((x >> n) | (x << (32 - n))) |
| #define | S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) |
| #define | S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) |
| #define | s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) |
| #define | s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) |