/Zephyr-latest/tests/bluetooth/bt_crypto_ccm/src/ |
D | test_vectors.h | 14 uint8_t nonce[13]; member 219 .nonce = {0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 231 .nonce = {0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x01, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 243 .nonce = {0x00, 0x00, 0x00, 0x05, 0x04, 0x03, 0x02, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 255 .nonce = {0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x03, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 267 .nonce = {0x00, 0x00, 0x00, 0x07, 0x06, 0x05, 0x04, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 279 .nonce = {0x00, 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 291 .nonce = {0x00, 0x00, 0x00, 0x09, 0x08, 0x07, 0x06, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 303 .nonce = {0x00, 0x00, 0x00, 0x0A, 0x09, 0x08, 0x07, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, 315 .nonce = {0x00, 0x00, 0x00, 0x0B, 0x0A, 0x09, 0x08, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5}, [all …]
|
D | test_bt_crypto_ccm.c | 38 err = bt_ccm_encrypt(p->key, p->nonce, &p->input[p->aad_len], in ZTEST() 56 err = bt_ccm_decrypt(p->key, p->nonce, &encrypted_data[p->aad_len], in ZTEST()
|
/Zephyr-latest/subsys/bluetooth/mesh/ |
D | crypto.c | 247 int bt_mesh_prov_nonce(const uint8_t dhkey[32], const uint8_t prov_salt[16], uint8_t nonce[13]) in bt_mesh_prov_nonce() 254 memcpy(nonce, tmp + 3, 13); in bt_mesh_prov_nonce() 289 static void create_proxy_nonce(uint8_t nonce[13], const uint8_t *pdu, in create_proxy_nonce() 292 memset(nonce, 0, 13); in create_proxy_nonce() 295 nonce[0] = 0x03; in create_proxy_nonce() 298 nonce[2] = pdu[2]; in create_proxy_nonce() 299 nonce[3] = pdu[3]; in create_proxy_nonce() 300 nonce[4] = pdu[4]; in create_proxy_nonce() 303 nonce[5] = pdu[5]; in create_proxy_nonce() 304 nonce[6] = pdu[6]; in create_proxy_nonce() [all …]
|
D | crypto_tc.c | 42 int bt_mesh_ccm_encrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *plaintext, in bt_mesh_ccm_encrypt() 46 return bt_ccm_encrypt(key->key, nonce, plaintext, len, aad, aad_len, enc_data, mic_size); in bt_mesh_ccm_encrypt() 49 int bt_mesh_ccm_decrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *enc_data, in bt_mesh_ccm_decrypt() 53 return bt_ccm_decrypt(key->key, nonce, enc_data, len, aad, aad_len, plaintext, mic_size); in bt_mesh_ccm_decrypt()
|
D | crypto.h | 26 int bt_mesh_ccm_encrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *plaintext, 30 int bt_mesh_ccm_decrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *enc_data, 94 int bt_mesh_prov_nonce(const uint8_t dhkey[32], const uint8_t prov_salt[16], uint8_t nonce[13]); 139 int bt_mesh_prov_decrypt(struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t data[25 + 8], 142 int bt_mesh_prov_encrypt(struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t data[25],
|
D | crypto_psa.c | 79 int bt_mesh_ccm_encrypt(const struct bt_mesh_key *key, uint8_t nonce[13], in bt_mesh_ccm_encrypt() 89 nonce, 13, in bt_mesh_ccm_encrypt() 102 int bt_mesh_ccm_decrypt(const struct bt_mesh_key *key, uint8_t nonce[13], in bt_mesh_ccm_decrypt() 112 nonce, 13, in bt_mesh_ccm_decrypt()
|
D | provisionee.c | 513 uint8_t nonce[13]; in prov_data() local 533 bt_mesh_prov_link.prov_salt, nonce); in prov_data() 540 LOG_DBG("Nonce: %s", bt_hex(nonce, 13)); in prov_data() 542 err = bt_mesh_prov_decrypt(&session_key, nonce, data, pdu); in prov_data()
|
D | provisioner.c | 498 uint8_t nonce[13]; in send_prov_data() local 510 bt_mesh_prov_link.prov_salt, nonce); in send_prov_data() 517 LOG_DBG("Nonce: %s", bt_hex(nonce, 13)); in send_prov_data() 553 err = bt_mesh_prov_encrypt(&session_key, nonce, &pdu.data[1], in send_prov_data()
|
/Zephyr-latest/tests/crypto/tinycrypt/src/ |
D | ccm_mode.c | 72 uint8_t *nonce, size_t nlen, in do_test() argument 86 result = tc_ccm_config(&c, &sched, nonce, nlen, mlen); in do_test() 131 uint8_t nonce[NONCE_LEN] = { in ZTEST() local 154 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in ZTEST() 169 uint8_t nonce[NONCE_LEN] = { in ZTEST() local 192 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in ZTEST() 207 uint8_t nonce[NONCE_LEN] = { in ZTEST() local 232 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), data, in ZTEST() 247 uint8_t nonce[NONCE_LEN] = { in ZTEST() local 271 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in ZTEST() [all …]
|
/Zephyr-latest/subsys/bluetooth/lib/ |
D | ead.c | 55 const uint8_t randomizer[BT_EAD_RANDOMIZER_SIZE], uint8_t *nonce) in bt_ead_generate_nonce() argument 72 memcpy(&nonce[0], randomizer, BT_EAD_RANDOMIZER_SIZE); in bt_ead_generate_nonce() 73 memcpy(&nonce[BT_EAD_RANDOMIZER_SIZE], iv, BT_EAD_IV_SIZE); in bt_ead_generate_nonce() 83 uint8_t nonce[BT_EAD_NONCE_SIZE]; in ead_encrypt() local 86 err = bt_ead_generate_nonce(iv, randomizer, nonce); in ead_encrypt() 91 memcpy(encrypted_payload, nonce, BT_EAD_RANDOMIZER_SIZE); in ead_encrypt() 93 err = bt_ccm_encrypt(session_key, nonce, payload, payload_size, bt_ead_aad, BT_EAD_AAD_SIZE, in ead_encrypt() 183 uint8_t nonce[BT_EAD_NONCE_SIZE]; in ead_decrypt() local 190 err = bt_ead_generate_nonce(iv, randomizer, nonce); in ead_decrypt() 197 err = bt_ccm_decrypt(session_key, nonce, encrypted_ad_data, payload_size, bt_ead_aad, in ead_decrypt()
|
/Zephyr-latest/subsys/bluetooth/host/ |
D | aes_ccm.c | 99 static int ccm_auth(const uint8_t key[16], uint8_t nonce[13], in ccm_auth() 114 memcpy(b + 1, nonce, 13); in ccm_auth() 152 static int ccm_crypt(const uint8_t key[16], const uint8_t nonce[13], in ccm_crypt() 167 memcpy(&a_i[1], nonce, 13); in ccm_crypt() 191 int bt_ccm_decrypt(const uint8_t key[16], uint8_t nonce[13], in bt_ccm_decrypt() 201 ccm_crypt(key, nonce, enc_data, plaintext, len); in bt_ccm_decrypt() 203 ccm_auth(key, nonce, plaintext, len, aad, aad_len, mic, mic_size); in bt_ccm_decrypt() 212 int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], in bt_ccm_encrypt() 219 LOG_DBG("nonce %s", bt_hex(nonce, 13)); in bt_ccm_encrypt() 228 ccm_auth(key, nonce, plaintext, len, aad, aad_len, mic, mic_size); in bt_ccm_encrypt() [all …]
|
/Zephyr-latest/subsys/net/l2/ieee802154/ |
D | ieee802154_security.c | 137 uint8_t nonce[13]; in ieee802154_decrypt_auth() local 148 memcpy(nonce, src_ext_addr, IEEE802154_EXT_ADDR_LENGTH); in ieee802154_decrypt_auth() 149 sys_put_be32(frame_counter, &nonce[8]); in ieee802154_decrypt_auth() 150 nonce[12] = level; in ieee802154_decrypt_auth() 154 ret = cipher_ccm_op(&sec_ctx->dec, &apkt, nonce); in ieee802154_decrypt_auth() 170 uint8_t nonce[13]; in ieee802154_encrypt_auth() local 191 memcpy(nonce, src_ext_addr, IEEE802154_EXT_ADDR_LENGTH); in ieee802154_encrypt_auth() 192 sys_put_be32(sec_ctx->frame_counter, &nonce[8]); in ieee802154_encrypt_auth() 193 nonce[12] = level; in ieee802154_encrypt_auth() 197 ret = cipher_ccm_op(&sec_ctx->enc, &apkt, nonce); in ieee802154_encrypt_auth()
|
/Zephyr-latest/subsys/secure_storage/src/its/transform/ |
D | aead.c | 10 const uint8_t nonce in psa_aead_crypt() 22 size_t key_size, psa_algorithm_t alg, const uint8_t *nonce, in psa_aead_crypt() 48 ret = aead_crypt(&key_attributes, key, sizeof(key), alg, nonce, in psa_aead_crypt() 68 uint8_t nonce[CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_NONCE_SIZE]; member 94 ret = secure_storage_its_transform_aead_get_nonce(stored_entry->nonce); in secure_storage_its_transform_to_store() 99 ret = psa_aead_crypt(PSA_KEY_USAGE_ENCRYPT, uid, stored_entry->nonce, sizeof(add_data), in secure_storage_its_transform_to_store() 124 ret = psa_aead_crypt(PSA_KEY_USAGE_DECRYPT, uid, stored_entry->nonce, sizeof(add_data), in secure_storage_its_transform_from_store()
|
D | aead_get.c | 120 uint8_t nonce[static CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_NONCE_SIZE]) in secure_storage_its_transform_aead_get_nonce() 141 memcpy(nonce, &s_nonce, sizeof(s_nonce)); in secure_storage_its_transform_aead_get_nonce()
|
/Zephyr-latest/modules/nrf_wifi/bus/ |
D | device.c | 61 config.p_cfg.nonce[0] = 0x16181648; in qspi_defconfig() 62 config.p_cfg.nonce[1] = 0x0; in qspi_defconfig() 63 config.p_cfg.nonce[2] = 0x1; in qspi_defconfig()
|
/Zephyr-latest/include/zephyr/bluetooth/ |
D | crypto.h | 92 int bt_ccm_decrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *enc_data, 116 int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13],
|
/Zephyr-latest/subsys/secure_storage/ |
D | Kconfig.its_transform | 23 # authentication tag (16) + nonce (12) 108 prompt "AEAD ITS transform module nonce provider" 111 bool "Default nonce provider" 113 The default nonce provider generates a random number for the first nonce with 114 psa_generate_random(), then increments it for every subsequent nonce. A random 118 bool "Custom nonce provider" 127 int "AEAD ITS transform module nonce size in bytes"
|
/Zephyr-latest/include/zephyr/crypto/ |
D | cipher.h | 69 uint8_t *nonce); 72 uint8_t *nonce);
|
D | crypto.h | 323 struct cipher_aead_pkt *pkt, uint8_t *nonce) in cipher_ccm_op() argument 329 return ctx->ops.ccm_crypt_hndlr(ctx, pkt, nonce); in cipher_ccm_op() 345 struct cipher_aead_pkt *pkt, uint8_t *nonce) in cipher_gcm_op() argument 351 return ctx->ops.gcm_crypt_hndlr(ctx, pkt, nonce); in cipher_gcm_op()
|
/Zephyr-latest/subsys/secure_storage/include/internal/zephyr/secure_storage/its/transform/ |
D | aead_get.h | 43 uint8_t nonce[static CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_NONCE_SIZE]);
|
/Zephyr-latest/drivers/crypto/ |
D | crypto_tc_shim.c | 102 struct cipher_aead_pkt *aead_op, uint8_t *nonce) in do_ccm_encrypt_mac() argument 109 if (tc_ccm_config(&ccm, &data->session_key, nonce, in do_ccm_encrypt_mac() 142 struct cipher_aead_pkt *aead_op, uint8_t *nonce) in do_ccm_decrypt_auth() argument 149 if (tc_ccm_config(&ccm, &data->session_key, nonce, in do_ccm_decrypt_auth()
|
D | crypto_mtls_shim.c | 182 uint8_t *nonce) in mtls_ccm_encrypt_auth() argument 187 ret = mbedtls_ccm_encrypt_and_tag(mtls_ctx, apkt->pkt->in_len, nonce, in mtls_ccm_encrypt_auth() 211 uint8_t *nonce) in mtls_ccm_decrypt_auth() argument 216 ret = mbedtls_ccm_auth_decrypt(mtls_ctx, apkt->pkt->in_len, nonce, in mtls_ccm_decrypt_auth() 243 uint8_t *nonce) in mtls_gcm_encrypt_auth() argument 249 apkt->pkt->in_len, nonce, in mtls_gcm_encrypt_auth() 271 uint8_t *nonce) in mtls_gcm_decrypt_auth() argument 276 ret = mbedtls_gcm_auth_decrypt(mtls_ctx, apkt->pkt->in_len, nonce, in mtls_gcm_decrypt_auth()
|
D | crypto_ataes132a.c | 670 struct cipher_aead_pkt *aead_op, uint8_t *nonce) in do_ccm_encrypt_mac() argument 713 aead_op, nonce, NULL); in do_ccm_encrypt_mac() 719 struct cipher_aead_pkt *aead_op, uint8_t *nonce) in do_ccm_decrypt_auth() argument 759 NULL, aead_op, nonce); in do_ccm_decrypt_auth()
|
/Zephyr-latest/subsys/bluetooth/controller/ll_sw/openisa/hal/RV32M1/radio/ |
D | radio.c | 139 } nonce; /* used by the B0 format but not in-situ */ member 1294 ctx_ccm.nonce.counter = ccm->counter; /* LSO to MSO, counter is LE */ in radio_ccm_rx_pkt_set() 1299 ctx_ccm.nonce.bytes[4] |= ccm->direction << 7; in radio_ccm_rx_pkt_set() 1300 memcpy(&ctx_ccm.nonce.bytes[5], ccm->iv, 8); /* LSO to MSO */ in radio_ccm_rx_pkt_set() 1393 ctx_ccm.nonce.counter = ccm->counter; /* LSO to MSO, counter is LE */ in radio_ccm_tx_pkt_set() 1398 ctx_ccm.nonce.bytes[4] |= ccm->direction << 7; in radio_ccm_tx_pkt_set() 1399 memcpy(&ctx_ccm.nonce.bytes[5], ccm->iv, 8); /* LSO to MSO */ in radio_ccm_tx_pkt_set() 1414 ctx_ccm.nonce.bytes, 13, in radio_ccm_tx_pkt_set() 1445 ctx_ccm.nonce.bytes, 13, in radio_ccm_is_done()
|
/Zephyr-latest/drivers/ieee802154/ |
D | ieee802154_cc2520.c | 1156 static inline void generate_nonce(uint8_t *ccm_nonce, uint8_t *nonce, in generate_nonce() argument 1159 nonce[0] = 0 | (apkt->ad_len ? 0x40 : 0) | (m << 3) | 1; in generate_nonce() 1161 memcpy(&nonce[1], ccm_nonce, 13); in generate_nonce() 1163 nonce[14] = (uint8_t)(apkt->pkt->in_len >> 8); in generate_nonce() 1164 nonce[15] = (uint8_t)(apkt->pkt->in_len); in generate_nonce() 1167 sys_mem_swap(nonce, 16); in generate_nonce()
|