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 is NGTCP2_HP_SAMPLELEN bytes long. The length of mask must be at least NGTCP2_HP_MASKLEN. The library only uses the first NGTCP2_HP_MASKLEN bytes of the produced mask. The buffer pointed by dest must have at least NGTCP2_HP_SAMPLELEN bytes available.

This function returns 0 if it succeeds, or -1.