INNER CODE UNIT · C
result_size
michelp/pgsodium · src/aead.c:245
size_t result_size = VARHDRSZ + crypto_aead_det_xchacha20_KEYBYTES;
bytea *result = _pgsodium_zalloc_bytea (result_size);
crypto_aead_det_xchacha20_keygen (PGSODIUM_UCHARDATA (result));
PG_RETURN_BYTEA_P (result);
}
PGDLLEXPORT PG_FUNCTION_INFO_V1 (pgsodium_crypto_aead_det_noncegen);
Datum
pgsodium_crypto_aead_det_noncegen (PG_FUNCTION_ARGS)
{
size_t result_size = VARHDRSZ + crypto_aead_det_xchacha20_NONCEBYTES;
bytea *result = _pgsodium_zalloc_bytea (result_size);
randombytes_buf (VARDATA (result), crypto_aead_det_xchacha20_NONCEBYTES);
PG_RETURN_BYTEA_P (result);
}
PG_FUNCTION_INFO_V1 (pgsodium_crypto_aead_det_encrypt);
Datum