Lines Matching refs:key
184 const unsigned char *key, size_t keylen, in dtls_p_hash() argument
196 hmac_a = dtls_hmac_new(key, keylen); in dtls_p_hash()
207 hmac_p = dtls_hmac_new(key, keylen); in dtls_p_hash()
214 dtls_hmac_init(hmac_p, key, keylen); in dtls_p_hash()
226 dtls_hmac_init(hmac_a, key, keylen); in dtls_p_hash()
231 dtls_hmac_init(hmac_p, key, keylen); in dtls_p_hash()
249 dtls_prf(const unsigned char *key, size_t keylen, in dtls_prf() argument
258 key, keylen, in dtls_prf()
318 dtls_psk_pre_master_secret(unsigned char *key, size_t keylen, in dtls_psk_pre_master_secret() argument
335 memcpy(p, key, keylen); in dtls_psk_pre_master_secret()
342 static void dtls_ec_key_to_uint32(const unsigned char *key, size_t key_size, in dtls_ec_key_to_uint32() argument
347 *result = dtls_uint32_to_int(&key[i * sizeof(uint32_t)]); in dtls_ec_key_to_uint32()
352 static void dtls_ec_key_from_uint32(const uint32_t *key, size_t key_size, in dtls_ec_key_from_uint32() argument
357 dtls_int_to_uint32(result, key[i]); in dtls_ec_key_from_uint32()
362 int dtls_ec_key_from_uint32_asn1(const uint32_t *key, size_t key_size, in dtls_ec_key_from_uint32_asn1() argument
369 if (key[i] == 0) in dtls_ec_key_from_uint32_asn1()
372 if (first && key[i] & 0x80000000) { in dtls_ec_key_from_uint32_asn1()
375 dtls_int_to_uint32(buf, key[i]); in dtls_ec_key_from_uint32_asn1()
377 } else if (first && !(key[i] & 0xFF800000)) { in dtls_ec_key_from_uint32_asn1()
378 buf[0] = (key[i] >> 16) & 0xff; in dtls_ec_key_from_uint32_asn1()
379 buf[1] = (key[i] >> 8) & 0xff; in dtls_ec_key_from_uint32_asn1()
380 buf[2] = key[i] & 0xff; in dtls_ec_key_from_uint32_asn1()
382 } else if (first && !(key[i] & 0xFFFF8000)) { in dtls_ec_key_from_uint32_asn1()
383 buf[0] = (key[i] >> 8) & 0xff; in dtls_ec_key_from_uint32_asn1()
384 buf[1] = key[i] & 0xff; in dtls_ec_key_from_uint32_asn1()
386 } else if (first && !(key[i] & 0xFFFFFF80)) { in dtls_ec_key_from_uint32_asn1()
387 buf[0] = key[i] & 0xff; in dtls_ec_key_from_uint32_asn1()
390 dtls_int_to_uint32(buf, key[i]); in dtls_ec_key_from_uint32_asn1()
527 unsigned char *key, size_t keylen, in dtls_encrypt() argument
533 ret = rijndael_set_key_enc_only(&ctx->data.ctx, key, 8 * keylen); in dtls_encrypt()
553 unsigned char *key, size_t keylen, in dtls_decrypt() argument
559 ret = rijndael_set_key_enc_only(&ctx->data.ctx, key, 8 * keylen); in dtls_decrypt()