34 #define ALLOC(size) palloc(size)
35 #define FREE(ptr) pfree(ptr)
37 #define ALLOC(size) malloc(size)
38 #define FREE(ptr) free(ptr)
67 #define HMAC_IPAD 0x36
68 #define HMAC_OPAD 0x5C
122 if (ctx->
hash == NULL)
143 uint8 *shrinkbuf = NULL;
163 shrinkbuf =
ALLOC(digest_size);
164 if (shrinkbuf == NULL)
169 memset(shrinkbuf, 0, digest_size);
172 if (hash_ctx == NULL)
309 return _(
"out of memory");
323 return _(
"internal error");
325 return _(
"out of memory");
#define Assert(condition)
int pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
int pg_cryptohash_init(pg_cryptohash_ctx *ctx)
void pg_cryptohash_free(pg_cryptohash_ctx *ctx)
pg_cryptohash_ctx * pg_cryptohash_create(pg_cryptohash_type type)
int pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest, size_t len)
const char * pg_cryptohash_error(pg_cryptohash_ctx *ctx)
pg_hmac_ctx * pg_hmac_create(pg_cryptohash_type type)
const char * pg_hmac_error(pg_hmac_ctx *ctx)
void pg_hmac_free(pg_hmac_ctx *ctx)
int pg_hmac_update(pg_hmac_ctx *ctx, const uint8 *data, size_t len)
int pg_hmac_init(pg_hmac_ctx *ctx, const uint8 *key, size_t len)
int pg_hmac_final(pg_hmac_ctx *ctx, uint8 *dest, size_t len)
#define MD5_DIGEST_LENGTH
void explicit_bzero(void *buf, size_t len)
#define SHA1_DIGEST_LENGTH
#define PG_SHA256_DIGEST_LENGTH
#define PG_SHA384_BLOCK_LENGTH
#define PG_SHA384_DIGEST_LENGTH
#define PG_SHA512_DIGEST_LENGTH
#define PG_SHA256_BLOCK_LENGTH
#define PG_SHA512_BLOCK_LENGTH
#define PG_SHA224_BLOCK_LENGTH
#define PG_SHA224_DIGEST_LENGTH
uint8 k_opad[PG_SHA512_BLOCK_LENGTH]
uint8 k_ipad[PG_SHA512_BLOCK_LENGTH]