references/NIST-PQ-Submission-Kyber-20201001/Additional_Implementations/clean/crypto_kem/kyber768/indcpa.c
/*************************************************
* Name:        pack_pk
*
* Description: Serialize the public key as concatenation of the
*              serialized vector of polynomials pk
*              and the public seed used to generate the matrix A.
*
* Arguments:   uint8_t *r:          pointer to the output serialized public key
*              polyvec *pk:         pointer to the input public-key polyvec
*              const uint8_t *seed: pointer to the input public seed
**************************************************/
pack_pk
Description: Serialize the public key as concatenation of the
serialized vector of polynomials pk
and the public seed used to generate the matrix A.

uint8_t *r:          pointer to the output serialized public key
polyvec *pk:         pointer to the input public-key polyvec
const uint8_t *seed: pointer to the input public seed
pack_pk Description : Serialize the public key as concatenation of the serialized vector of polynomials pk and the public seed used to generate the matrix A . uint8_t * r : pointer to the output serialized public key polyvec * pk : pointer to the input public - key polyvec const uint8_t * seed : pointer to the input public seed
static void pack_pk(uint8_t r[KYBER_INDCPA_PUBLICKEYBYTES],
                    polyvec *pk,
                    const uint8_t seed[KYBER_SYMBYTES]) {
    size_t i;
    polyvec_tobytes(r, pk);
    for (i = 0; i < KYBER_SYMBYTES; i++) {
        r[i + KYBER_POLYVECBYTES] = seed[i];
    }
}
static void pack_pk ( uint8_t r [ KYBER_INDCPA_PUBLICKEYBYTES ] , polyvec * pk , const uint8_t seed [ KYBER_SYMBYTES ] ) { size_t i ; polyvec_tobytes ( r , pk ) ; for ( i = 0 ; i < KYBER_SYMBYTES ; i ++ ) { r [ i + KYBER_POLYVECBYTES ] = seed [ i ] ; } }
Name:        pack_pk
Description: Serialize the public key as concatenation of the
serialized vector of polynomials pk
and the public seed used to generate the matrix A.
Name : pack_pk Description : Serialize the public key as concatenation of the serialized vector of polynomials pk and the public seed used to generate the matrix A .