MCPcopy Create free account
hub / github.com/apache/cloudberry / pg_cryptohash_create

Function pg_cryptohash_create

src/common/cryptohash.c:66–84  ·  view source on GitHub ↗

* pg_cryptohash_create * * Allocate a hash context. Returns NULL on failure for an OOM. The * backend issues an error, without returning. */

Source from the content-addressed store, hash-verified

64 * backend issues an error, without returning.
65 */
66pg_cryptohash_ctx *
67pg_cryptohash_create(pg_cryptohash_type type)
68{
69 pg_cryptohash_ctx *ctx;
70
71 /*
72 * Note that this always allocates enough space for the largest hash. A
73 * smaller allocation would be enough for md5, sha224 and sha256, but the
74 * small extra amount of memory does not make it worth complicating this
75 * code.
76 */
77 ctx = ALLOC(sizeof(pg_cryptohash_ctx));
78 if (ctx == NULL)
79 return NULL;
80 memset(ctx, 0, sizeof(pg_cryptohash_ctx));
81 ctx->type = type;
82
83 return ctx;
84}
85
86/*
87 * pg_cryptohash_init

Callers 15

scram_HFunction · 0.70
pg_hmac_createFunction · 0.70
pg_hmac_initFunction · 0.70
pg_checksum_initFunction · 0.70
pg_md5_hashFunction · 0.70
pg_md5_binaryFunction · 0.70
uuid_generate_internalFunction · 0.50
init_sm3Function · 0.50
init_sha224Function · 0.50
init_sha256Function · 0.50
init_sha384Function · 0.50
init_sha512Function · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected