Home
last modified time | relevance | path

Searched refs:nonce (Results 1 – 9 of 9) sorted by relevance

/mcuboot-latest/ext/tinycrypt/lib/source/
Dctr_mode.c43 uint8_t nonce[TC_AES_BLOCK_SIZE]; in tc_ctr_mode() local
61 (void)_copy(nonce, sizeof(nonce), ctr, sizeof(nonce)); in tc_ctr_mode()
64 block_num = (nonce[12] << 24) | (nonce[13] << 16) | in tc_ctr_mode()
65 (nonce[14] << 8) | (nonce[15]); in tc_ctr_mode()
70 if (tc_aes_encrypt(buffer, nonce, sched)) { in tc_ctr_mode()
72 nonce[12] = (uint8_t)(block_num >> 24); in tc_ctr_mode()
73 nonce[13] = (uint8_t)(block_num >> 16); in tc_ctr_mode()
74 nonce[14] = (uint8_t)(block_num >> 8); in tc_ctr_mode()
75 nonce[15] = (uint8_t)(block_num); in tc_ctr_mode()
87 ctr[12] = nonce[12]; ctr[13] = nonce[13]; in tc_ctr_mode()
[all …]
Dccm_mode.c39 int tc_ccm_config(TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce, in tc_ccm_config() argument
46 nonce == (uint8_t *) 0) { in tc_ccm_config()
56 c->nonce = nonce; in tc_ccm_config()
98 uint8_t nonce[TC_AES_BLOCK_SIZE]; in ccm_ctr_mode() local
114 (void) _copy(nonce, sizeof(nonce), ctr, sizeof(nonce)); in ccm_ctr_mode()
117 block_num = (uint16_t) ((nonce[14] << 8)|(nonce[15])); in ccm_ctr_mode()
121 nonce[14] = (uint8_t)(block_num >> 8); in ccm_ctr_mode()
122 nonce[15] = (uint8_t)(block_num); in ccm_ctr_mode()
123 if (!tc_aes_encrypt(buffer, nonce, sched)) { in ccm_ctr_mode()
132 ctr[14] = nonce[14]; ctr[15] = nonce[15]; in ccm_ctr_mode()
[all …]
/mcuboot-latest/ext/tinycrypt/tests/
Dtest_ccm_mode.c70 int do_test(const uint8_t *key, uint8_t *nonce, in do_test() argument
86 result = tc_ccm_config(&c, &sched, nonce, nlen, mlen); in do_test()
140 uint8_t nonce[NONCE_LEN] = { in test_vector_1() local
163 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in test_vector_1()
177 uint8_t nonce[NONCE_LEN] = { in test_vector_2() local
200 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in test_vector_2()
214 uint8_t nonce[NONCE_LEN] = { in test_vector_3() local
239 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), data, in test_vector_3()
253 uint8_t nonce[NONCE_LEN] = { in test_vector_4() local
277 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in test_vector_4()
[all …]
/mcuboot-latest/ext/tinycrypt/lib/include/tinycrypt/
Dccm_mode.h93 uint8_t *nonce; /* nonce required by CCM */ member
111 int tc_ccm_config(TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce,
/mcuboot-latest/boot/bootutil/src/
Dencrypted.c695 uint8_t nonce[16]; in boot_enc_encrypt() local
702 memset(nonce, 0, 12); in boot_enc_encrypt()
704 nonce[12] = (uint8_t)(off >> 24); in boot_enc_encrypt()
705 nonce[13] = (uint8_t)(off >> 16); in boot_enc_encrypt()
706 nonce[14] = (uint8_t)(off >> 8); in boot_enc_encrypt()
707 nonce[15] = (uint8_t)off; in boot_enc_encrypt()
710 bootutil_aes_ctr_encrypt(&enc->aes_ctr, nonce, buf, sz, blk_off, buf); in boot_enc_encrypt()
718 uint8_t nonce[16]; in boot_enc_decrypt() local
725 memset(nonce, 0, 12); in boot_enc_decrypt()
727 nonce[12] = (uint8_t)(off >> 24); in boot_enc_decrypt()
[all …]
/mcuboot-latest/ext/tinycrypt/documentation/
Dtinycrypt.rst151 step: entropy seed, personalization and a nonce (which is not implemented).
200 the nonce size, which is: 15-q bytes. The maximum payload length for those
207 The nonce size is: 13 bytes.
233 same nonce for two different messages which are encrypted with the same
/mcuboot-latest/sim/src/
Dtlv.rs742 let nonce = GenericArray::from_slice(&[0; 16]); in make_tlv() localVariable
747 let mut cipher = Aes256Ctr::from_block_cipher(block, &nonce); in make_tlv()
752 let mut cipher = Aes128Ctr::from_block_cipher(block, &nonce); in make_tlv()
Dimage.rs1853 let nonce = GenericArray::from_slice(&[0; 16]); in install_image() localVariable
1858 let mut cipher = Aes256Ctr::from_block_cipher(block, &nonce); in install_image()
1863 let mut cipher = Aes128Ctr::from_block_cipher(block, &nonce); in install_image()
/mcuboot-latest/scripts/imgtool/
Dimage.py664 nonce = bytes([0] * 16)
665 cipher = Cipher(algorithms.AES(plainkey), modes.CTR(nonce),