picoquic/tls_api.c
static int picoquic_set_aead_from_secret(void ** v_aead,ptls_cipher_suite_t * cipher, int is_enc, const void *secret)
{
    int ret = 0;

    if (*v_aead != NULL) {
        ptls_aead_free((ptls_aead_context_t*)*v_aead);
    }

    if ((*v_aead = ptls_aead_new(cipher->aead, cipher->hash, is_enc, secret, PICOQUIC_LABEL_QUIC_KEY_BASE)) == NULL) {
        ret = PTLS_ERROR_NO_MEMORY;
    }

    return ret;
}
/* set key from secret: this is used to create AEAD contexts and PN encoding contexts
 * after a key update callback, and also to create the initial keys from a locally
 * computed secret
 */
set key from secret: this is used to create AEAD contexts and PN encoding contexts
after a key update callback, and also to create the initial keys from a locally
computed secret
set key from secret : this is used to create AEAD contexts and PN encoding contexts after a key update callback and also to create the initial keys from a locally computed secret
static int picoquic_set_aead_from_secret(void ** v_aead,ptls_cipher_suite_t * cipher, int is_enc, const void *secret)
{
    int ret = 0;
    if (*v_aead != NULL) {
        ptls_aead_free((ptls_aead_context_t*)*v_aead);
    }
    if ((*v_aead = ptls_aead_new(cipher->aead, cipher->hash, is_enc, secret, PICOQUIC_LABEL_QUIC_KEY_BASE)) == NULL) {
        ret = PTLS_ERROR_NO_MEMORY;
    }
    return ret;
}
static int picoquic_set_aead_from_secret ( void * * v_aead , ptls_cipher_suite_t * cipher , int is_enc , const void * secret ) { int ret = 0 ; if ( * v_aead != NULL ) { ptls_aead_free ( ( ptls_aead_context_t * ) * v_aead ) ; } if ( ( * v_aead = ptls_aead_new ( cipher -> aead , cipher -> hash , is_enc , secret , PICOQUIC_LABEL_QUIC_KEY_BASE ) ) == NULL ) { ret = PTLS_ERROR_NO_MEMORY ; } return ret ; }
set key from secret: this is used to create AEAD contexts and PN encoding contexts
 after a key update callback, and also to create the initial keys from a locally
 computed secret
set key from secret : this is used to create AEAD contexts and PN encoding contexts after a key update callback and also to create the initial keys from a locally computed secret