PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | ALLOC(size) palloc(size) |
#define | FREE(ptr) pfree(ptr) |
#define | PG_SHA256_SHORT_BLOCK_LENGTH (PG_SHA256_BLOCK_LENGTH - 8) |
#define | PG_SHA384_SHORT_BLOCK_LENGTH (PG_SHA384_BLOCK_LENGTH - 16) |
#define | PG_SHA512_SHORT_BLOCK_LENGTH (PG_SHA512_BLOCK_LENGTH - 16) |
#define | REVERSE32(w, x) |
#define | REVERSE64(w, x) |
#define | ADDINC128(w, n) |
#define | R(b, x) ((x) >> (b)) |
#define | S32(b, x) (((x) >> (b)) | ((x) << (32 - (b)))) |
#define | S64(b, x) (((x) >> (b)) | ((x) << (64 - (b)))) |
#define | Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) |
#define | Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) |
#define | Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) |
#define | Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) |
#define | sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) |
#define | sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) |
#define | Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) |
#define | Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) |
#define | sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) |
#define | sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) |
Functions | |
static void | SHA512_Last (pg_sha512_ctx *context) |
static void | SHA256_Transform (pg_sha256_ctx *context, const uint8 *data) |
static void | SHA512_Transform (pg_sha512_ctx *context, const uint8 *data) |
void | pg_sha256_init (pg_sha256_ctx *context) |
void | pg_sha256_update (pg_sha256_ctx *context, const uint8 *data, size_t len) |
static void | SHA256_Last (pg_sha256_ctx *context) |
void | pg_sha256_final (pg_sha256_ctx *context, uint8 *digest) |
void | pg_sha512_init (pg_sha512_ctx *context) |
void | pg_sha512_update (pg_sha512_ctx *context, const uint8 *data, size_t len) |
void | pg_sha512_final (pg_sha512_ctx *context, uint8 *digest) |
void | pg_sha384_init (pg_sha384_ctx *context) |
void | pg_sha384_update (pg_sha384_ctx *context, const uint8 *data, size_t len) |
void | pg_sha384_final (pg_sha384_ctx *context, uint8 *digest) |
void | pg_sha224_init (pg_sha224_ctx *context) |
void | pg_sha224_update (pg_sha224_ctx *context, const uint8 *data, size_t len) |
void | pg_sha224_final (pg_sha224_ctx *context, uint8 *digest) |
Variables | |
static const uint32 | K256 [64] |
static const uint32 | sha224_initial_hash_value [8] |
static const uint32 | sha256_initial_hash_value [8] |
static const uint64 | K512 [80] |
static const uint64 | sha384_initial_hash_value [8] |
static const uint64 | sha512_initial_hash_value [8] |
#define ADDINC128 | ( | w, | |
n | |||
) |
#define PG_SHA256_SHORT_BLOCK_LENGTH (PG_SHA256_BLOCK_LENGTH - 8) |
#define PG_SHA384_SHORT_BLOCK_LENGTH (PG_SHA384_BLOCK_LENGTH - 16) |
#define PG_SHA512_SHORT_BLOCK_LENGTH (PG_SHA512_BLOCK_LENGTH - 16) |
#define REVERSE32 | ( | w, | |
x | |||
) |
#define REVERSE64 | ( | w, | |
x | |||
) |
void pg_sha224_final | ( | pg_sha224_ctx * | context, |
uint8 * | digest | ||
) |
Definition at line 994 of file sha2.c.
References context, j, PG_SHA224_DIGEST_LENGTH, REVERSE32, and SHA256_Last().
Referenced by pg_cryptohash_final().
void pg_sha224_init | ( | pg_sha224_ctx * | context | ) |
Definition at line 978 of file sha2.c.
References context, PG_SHA256_BLOCK_LENGTH, PG_SHA256_DIGEST_LENGTH, and sha224_initial_hash_value.
Referenced by pg_cryptohash_init().
void pg_sha224_update | ( | pg_sha224_ctx * | context, |
const uint8 * | data, | ||
size_t | len | ||
) |
Definition at line 988 of file sha2.c.
References context, data, len, and pg_sha256_update().
Referenced by pg_cryptohash_update().
void pg_sha256_final | ( | pg_sha256_ctx * | context, |
uint8 * | digest | ||
) |
Definition at line 577 of file sha2.c.
References context, j, PG_SHA256_DIGEST_LENGTH, REVERSE32, and SHA256_Last().
Referenced by pg_cryptohash_final().
void pg_sha256_init | ( | pg_sha256_ctx * | context | ) |
Definition at line 279 of file sha2.c.
References context, PG_SHA256_BLOCK_LENGTH, PG_SHA256_DIGEST_LENGTH, and sha256_initial_hash_value.
Referenced by pg_cryptohash_init().
void pg_sha256_update | ( | pg_sha256_ctx * | context, |
const uint8 * | data, | ||
size_t | len | ||
) |
Definition at line 476 of file sha2.c.
References context, data, len, PG_SHA256_BLOCK_LENGTH, and SHA256_Transform().
Referenced by pg_cryptohash_update(), and pg_sha224_update().
void pg_sha384_final | ( | pg_sha384_ctx * | context, |
uint8 * | digest | ||
) |
Definition at line 950 of file sha2.c.
References context, j, PG_SHA384_DIGEST_LENGTH, REVERSE64, and SHA512_Last().
Referenced by pg_cryptohash_final().
void pg_sha384_init | ( | pg_sha384_ctx * | context | ) |
Definition at line 934 of file sha2.c.
References context, PG_SHA384_BLOCK_LENGTH, PG_SHA512_DIGEST_LENGTH, and sha384_initial_hash_value.
Referenced by pg_cryptohash_init().
void pg_sha384_update | ( | pg_sha384_ctx * | context, |
const uint8 * | data, | ||
size_t | len | ||
) |
Definition at line 944 of file sha2.c.
References context, data, len, and pg_sha512_update().
Referenced by pg_cryptohash_update().
void pg_sha512_final | ( | pg_sha512_ctx * | context, |
uint8 * | digest | ||
) |
Definition at line 905 of file sha2.c.
References context, j, PG_SHA512_DIGEST_LENGTH, REVERSE64, and SHA512_Last().
Referenced by pg_cryptohash_final().
void pg_sha512_init | ( | pg_sha512_ctx * | context | ) |
Definition at line 605 of file sha2.c.
References context, PG_SHA512_BLOCK_LENGTH, PG_SHA512_DIGEST_LENGTH, and sha512_initial_hash_value.
Referenced by pg_cryptohash_init().
void pg_sha512_update | ( | pg_sha512_ctx * | context, |
const uint8 * | data, | ||
size_t | len | ||
) |
Definition at line 802 of file sha2.c.
References ADDINC128, context, data, len, PG_SHA512_BLOCK_LENGTH, and SHA512_Transform().
Referenced by pg_cryptohash_update(), and pg_sha384_update().
|
static |
Definition at line 529 of file sha2.c.
References context, PG_SHA256_BLOCK_LENGTH, PG_SHA256_SHORT_BLOCK_LENGTH, REVERSE64, and SHA256_Transform().
Referenced by pg_sha224_final(), and pg_sha256_final().
|
static |
Definition at line 386 of file sha2.c.
References a, b, Ch, context, data, j, K256, Maj, s1, Sigma0_256, and Sigma1_256.
Referenced by pg_sha256_update(), and SHA256_Last().
|
static |
Definition at line 855 of file sha2.c.
References context, PG_SHA512_BLOCK_LENGTH, PG_SHA512_SHORT_BLOCK_LENGTH, REVERSE64, and SHA512_Transform().
Referenced by pg_sha384_final(), and pg_sha512_final().
|
static |
Definition at line 712 of file sha2.c.
References a, b, Ch, context, data, j, K512, Maj, s1, Sigma0_512, and Sigma1_512.
Referenced by pg_sha512_update(), and SHA512_Last().
|
static |
Definition at line 165 of file sha2.c.
Referenced by SHA256_Transform().
|
static |
Definition at line 209 of file sha2.c.
Referenced by SHA512_Transform().
|
static |
Definition at line 185 of file sha2.c.
Referenced by pg_sha224_init().
|
static |
Definition at line 197 of file sha2.c.
Referenced by pg_sha256_init().
|
static |
Definition at line 253 of file sha2.c.
Referenced by pg_sha384_init().
|
static |
Definition at line 265 of file sha2.c.
Referenced by pg_sha512_init().