Lines Matching refs:kdf
599 static srtp_err_status_t srtp_kdf_init(srtp_kdf_t *kdf, in srtp_kdf_init() argument
604 memset(kdf, 0x0, sizeof(srtp_kdf_t)); in srtp_kdf_init()
615 kdf->evp = EVP_aes_256_ctr(); in srtp_kdf_init()
618 kdf->evp = EVP_aes_192_ctr(); in srtp_kdf_init()
621 kdf->evp = EVP_aes_128_ctr(); in srtp_kdf_init()
627 memcpy(kdf->master_key, key, key_len); in srtp_kdf_init()
628 memcpy(kdf->master_salt, key + key_len, salt_len); in srtp_kdf_init()
632 static srtp_err_status_t srtp_kdf_generate(srtp_kdf_t *kdf, in srtp_kdf_generate() argument
640 if (!kdf->evp) in srtp_kdf_generate()
649 ret = kdf_srtp(kdf->evp, (char *)&kdf->master_key, in srtp_kdf_generate()
650 (char *)&kdf->master_salt, NULL, NULL, label, (char *)key); in srtp_kdf_generate()
658 static srtp_err_status_t srtp_kdf_clear(srtp_kdf_t *kdf) in srtp_kdf_clear() argument
660 octet_string_set_to_zero(kdf->master_key, MAX_SRTP_AESKEY_LEN); in srtp_kdf_clear()
661 octet_string_set_to_zero(kdf->master_salt, MAX_SRTP_SALT_LEN); in srtp_kdf_clear()
662 kdf->evp = NULL; in srtp_kdf_clear()
677 static srtp_err_status_t srtp_kdf_init(srtp_kdf_t *kdf, in srtp_kdf_init() argument
699 stat = srtp_crypto_kernel_alloc_cipher(cipher_id, &kdf->cipher, key_len, 0); in srtp_kdf_init()
703 stat = srtp_cipher_init(kdf->cipher, key); in srtp_kdf_init()
705 srtp_cipher_dealloc(kdf->cipher); in srtp_kdf_init()
711 static srtp_err_status_t srtp_kdf_generate(srtp_kdf_t *kdf, in srtp_kdf_generate() argument
723 status = srtp_cipher_set_iv(kdf->cipher, (uint8_t *)&nonce, in srtp_kdf_generate()
730 status = srtp_cipher_encrypt(kdf->cipher, key, &length); in srtp_kdf_generate()
737 static srtp_err_status_t srtp_kdf_clear(srtp_kdf_t *kdf) in srtp_kdf_clear() argument
740 status = srtp_cipher_dealloc(kdf->cipher); in srtp_kdf_clear()
743 kdf->cipher = NULL; in srtp_kdf_clear()
870 srtp_kdf_t kdf; in srtp_stream_init_keys() local
938 stat = srtp_kdf_init(&kdf, (const uint8_t *)tmp_key, rtp_base_key_len, in srtp_stream_init_keys()
941 stat = srtp_kdf_init(&kdf, (const uint8_t *)tmp_key, kdf_keylen); in srtp_stream_init_keys()
950 stat = srtp_kdf_generate(&kdf, label_rtp_encryption, tmp_key, in srtp_stream_init_keys()
968 stat = srtp_kdf_generate(&kdf, label_rtp_salt, in srtp_stream_init_keys()
1055 xtn_hdr_kdf = &kdf; in srtp_stream_init_keys()
1103 if (xtn_hdr_kdf != &kdf) { in srtp_stream_init_keys()
1115 stat = srtp_kdf_generate(&kdf, label_rtp_msg_auth, tmp_key, in srtp_stream_init_keys()
1144 stat = srtp_kdf_generate(&kdf, label_rtcp_encryption, tmp_key, in srtp_stream_init_keys()
1161 stat = srtp_kdf_generate(&kdf, label_rtcp_salt, in srtp_stream_init_keys()
1188 stat = srtp_kdf_generate(&kdf, label_rtcp_msg_auth, tmp_key, in srtp_stream_init_keys()
1210 stat = srtp_kdf_clear(&kdf); in srtp_stream_init_keys()