references/NIST-PQ-Submission-Kyber-20201001/Additional_Implementations/clean/crypto_kem/kyber768/indcpa.c
/*************************************************
* Name:        unpack_pk
*
* Description: De-serialize public key from a byte array;
*              approximate inverse of pack_pk
*
* Arguments:   - polyvec *pk:             pointer to output public-key
*                                         polynomial vector
*              - uint8_t *seed:           pointer to output seed to generate
*                                         matrix A
*              - const uint8_t *packedpk: pointer to input serialized public key
**************************************************/
unpack_pk
Description: De-serialize public key from a byte array;
approximate inverse of pack_pk

- polyvec *pk:             pointer to output public-key
polynomial vector
uint8_t *seed:           pointer to output seed to generate
matrix A
const uint8_t *packedpk: pointer to input serialized public key
unpack_pk Description : De - serialize public key from a byte array ; approximate inverse of pack_pk - polyvec * pk : pointer to output public - key polynomial vector uint8_t * seed : pointer to output seed to generate matrix A const uint8_t * packedpk : pointer to input serialized public key
static void unpack_pk(polyvec *pk,
                      uint8_t seed[KYBER_SYMBYTES],
                      const uint8_t packedpk[KYBER_INDCPA_PUBLICKEYBYTES]) {
    size_t i;
    polyvec_frombytes(pk, packedpk);
    for (i = 0; i < KYBER_SYMBYTES; i++) {
        seed[i] = packedpk[i + KYBER_POLYVECBYTES];
    }
}
static void unpack_pk ( polyvec * pk , uint8_t seed [ KYBER_SYMBYTES ] , const uint8_t packedpk [ KYBER_INDCPA_PUBLICKEYBYTES ] ) { size_t i ; polyvec_frombytes ( pk , packedpk ) ; for ( i = 0 ; i < KYBER_SYMBYTES ; i ++ ) { seed [ i ] = packedpk [ i + KYBER_POLYVECBYTES ] ; } }
Name:        unpack_pk
Description: De-serialize public key from a byte array;
approximate inverse of pack_pk
Name : unpack_pk Description : De - serialize public key from a byte array ; approximate inverse of pack_pk