ngtcp2_crypto_hp_mask
Synopsis
#include <ngtcp2/ngtcp2_crypto.h>
-
int ngtcp2_crypto_hp_mask(uint8_t *dest, const ngtcp2_crypto_cipher *hp, const ngtcp2_crypto_cipher_ctx *hp_ctx, const uint8_t *sample)
ngtcp2_crypto_hp_mask()
generates a mask which is used in packet header encryption. The mask is written to the buffer pointed by dest. The sample is passed as sample which isNGTCP2_HP_SAMPLELEN
bytes long. The length of mask must be at leastNGTCP2_HP_MASKLEN
. The library only uses the firstNGTCP2_HP_MASKLEN
bytes of the produced mask. The buffer pointed by dest must have at leastNGTCP2_HP_SAMPLELEN
bytes available.This function returns 0 if it succeeds, or -1.