Home
last modified time | relevance | path

Searched refs:iv (Results 1 – 25 of 155) sorted by relevance

1234567

/optee_os/core/crypto/
A Dsm4-cbc.c20 uint8_t iv[16]; member
36 const uint8_t *iv, size_t iv_len) in sm4_cbc_init() argument
40 if (key1_len != 16 || iv_len != sizeof(c->iv)) in sm4_cbc_init()
48 memcpy(c->iv, iv, sizeof(c->iv)); in sm4_cbc_init()
59 sm4_crypt_cbc(&c->state, len, c->iv, data, dst); in sm4_cbc_update()
69 memzero_explicit(&c->iv, sizeof(c->iv)); in sm4_cbc_final()
84 memcpy(dst->iv, src->iv, sizeof(src->iv)); in sm4_cbc_copy_state()
/optee_os/lib/libmbedtls/core/
A Daes_cbc.c25 unsigned char iv[TEE_AES_BLOCK_SIZE]; member
42 const uint8_t *iv, size_t iv_len) in mbed_aes_cbc_init() argument
47 if (iv_len != sizeof(c->iv)) in mbed_aes_cbc_init()
49 memcpy(c->iv, iv, sizeof(c->iv)); in mbed_aes_cbc_init()
76 if (mbedtls_aes_crypt_cbc(&c->aes_ctx, c->mbed_mode, len, c->iv, in mbed_aes_cbc_update()
99 memcpy(dst->iv, src->iv, sizeof(dst->iv)); in mbed_aes_cbc_copy_state()
128 unsigned char iv[16], const unsigned char *input, in mbedtls_aes_crypt_cbc()
136 ctx->round_count, length / 16, iv); in mbedtls_aes_crypt_cbc()
139 ctx->round_count, length / 16, iv); in mbedtls_aes_crypt_cbc()
A Ddes_cbc.c21 unsigned char iv[TEE_DES_BLOCK_SIZE]; member
38 const uint8_t *iv __unused, in mbed_des_cbc_init()
46 if (iv_len != sizeof(c->iv)) in mbed_des_cbc_init()
48 memcpy(c->iv, iv, sizeof(c->iv)); in mbed_des_cbc_init()
73 if (mbedtls_des_crypt_cbc(&c->des_ctx, c->mbed_mode, len, c->iv, in mbed_des_cbc_update()
96 memcpy(dst->iv, src->iv, sizeof(dst->iv)); in mbed_des_cbc_copy_state()
A Ddes3_cbc.c21 unsigned char iv[TEE_DES_BLOCK_SIZE]; member
38 const uint8_t *iv __unused, in mbed_des3_cbc_init()
47 if (iv_len != sizeof(c->iv)) in mbed_des3_cbc_init()
49 memcpy(c->iv, iv, sizeof(c->iv)); in mbed_des3_cbc_init()
80 if (mbedtls_des3_crypt_cbc(&c->des3_ctx, c->mbed_mode, len, c->iv, in mbed_des3_cbc_update()
103 memcpy(dst->iv, src->iv, sizeof(dst->iv)); in mbed_des3_cbc_copy_state()
/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/
A Dchacha20poly1305_setiv.c22 int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen) in chacha20poly1305_setiv() argument
29 LTC_ARGCHK(iv != NULL); in chacha20poly1305_setiv()
35 if ((err = chacha_ivctr32(&st->chacha, iv, ivlen, 1)) != CRYPT_OK) return err; in chacha20poly1305_setiv()
39 if ((err = chacha_ivctr64(&st->chacha, iv, ivlen, 1)) != CRYPT_OK) return err; in chacha20poly1305_setiv()
48 if ((err = chacha_ivctr32(&tmp_st, iv, ivlen, 0)) != CRYPT_OK) return err; in chacha20poly1305_setiv()
52 if ((err = chacha_ivctr64(&tmp_st, iv, ivlen, 0)) != CRYPT_OK) return err; in chacha20poly1305_setiv()
/optee_os/core/lib/libtomcrypt/src/stream/chacha/
A Dchacha_ivctr32.c28 int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong32 counter) in chacha_ivctr32() argument
31 LTC_ARGCHK(iv != NULL); in chacha_ivctr32()
36 LOAD32L(st->input[13], iv + 0); in chacha_ivctr32()
37 LOAD32L(st->input[14], iv + 4); in chacha_ivctr32()
38 LOAD32L(st->input[15], iv + 8); in chacha_ivctr32()
A Dchacha_ivctr64.c28 int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counter) in chacha_ivctr64() argument
31 LTC_ARGCHK(iv != NULL); in chacha_ivctr64()
37 LOAD32L(st->input[14], iv + 0); in chacha_ivctr64()
38 LOAD32L(st->input[15], iv + 4); in chacha_ivctr64()
/optee_os/lib/libmbedtls/mbedtls/library/
A Dblowfish.c270 unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], in mbedtls_blowfish_crypt_cbc()
279 BLOWFISH_VALIDATE_RET( iv != NULL ); in mbedtls_blowfish_crypt_cbc()
296 memcpy( iv, temp, MBEDTLS_BLOWFISH_BLOCKSIZE ); in mbedtls_blowfish_crypt_cbc()
308 output[i] = (unsigned char)( input[i] ^ iv[i] ); in mbedtls_blowfish_crypt_cbc()
311 memcpy( iv, output, MBEDTLS_BLOWFISH_BLOCKSIZE ); in mbedtls_blowfish_crypt_cbc()
341 BLOWFISH_VALIDATE_RET( iv != NULL ); in mbedtls_blowfish_crypt_cfb64()
355 mbedtls_blowfish_crypt_ecb( ctx, MBEDTLS_BLOWFISH_ENCRYPT, iv, iv ); in mbedtls_blowfish_crypt_cfb64()
358 *output++ = (unsigned char)( c ^ iv[n] ); in mbedtls_blowfish_crypt_cfb64()
359 iv[n] = (unsigned char) c; in mbedtls_blowfish_crypt_cfb64()
369 mbedtls_blowfish_crypt_ecb( ctx, MBEDTLS_BLOWFISH_ENCRYPT, iv, iv ); in mbedtls_blowfish_crypt_cfb64()
[all …]
A Dcipher.c231 memcpy( dst->iv, src->iv, MBEDTLS_MAX_IV_LENGTH ); in mbedtls_cipher_clone()
411 const unsigned char *iv, in mbedtls_cipher_set_iv() argument
417 CIPHER_VALIDATE_RET( iv_len == 0 || iv != NULL ); in mbedtls_cipher_set_iv()
449 iv, in mbedtls_cipher_set_iv()
459 memcpy( ctx->iv, iv, actual_iv_size ); in mbedtls_cipher_set_iv()
732 ilen, &ctx->unprocessed_len, ctx->iv, in mbedtls_cipher_update()
1246 CIPHER_VALIDATE_RET( iv_len == 0 || iv != NULL ); in mbedtls_cipher_crypt()
1360 iv, iv_len, in mbedtls_cipher_aead_encrypt()
1440 iv, iv_len, in mbedtls_cipher_aead_decrypt()
1594 (void) iv; in mbedtls_cipher_auth_encrypt_ext()
[all …]
A Daria.c628 ARIA_VALIDATE_RET( iv != NULL ); in mbedtls_aria_crypt_cbc()
690 ARIA_VALIDATE_RET( iv != NULL ); in mbedtls_aria_crypt_cfb128()
706 mbedtls_aria_crypt_ecb( ctx, iv, iv ); in mbedtls_aria_crypt_cfb128()
709 *output++ = c ^ iv[n]; in mbedtls_aria_crypt_cfb128()
710 iv[n] = c; in mbedtls_aria_crypt_cfb128()
720 mbedtls_aria_crypt_ecb( ctx, iv, iv ); in mbedtls_aria_crypt_cfb128()
722 iv[n] = *output++ = (unsigned char)( iv[n] ^ *input++ ); in mbedtls_aria_crypt_cfb128()
947 uint8_t buf[48], iv[MBEDTLS_ARIA_BLOCKSIZE]; in mbedtls_aria_self_test() local
1032 iv, aria_test2_cfb_ct[i], buf ); in mbedtls_aria_self_test()
1050 mbedtls_aria_crypt_ctr( &ctx, 48, &j, iv, blk, in mbedtls_aria_self_test()
[all …]
A Dccm.c200 memcpy( b + 1, iv, iv_len ); in ccm_auth_crypt()
258 memcpy( ctr + 1, iv, iv_len ); in ccm_auth_crypt()
321 const unsigned char *iv, size_t iv_len, in mbedtls_ccm_star_encrypt_and_tag() argument
327 CCM_VALIDATE_RET( iv != NULL ); in mbedtls_ccm_star_encrypt_and_tag()
337 const unsigned char *iv, size_t iv_len, in mbedtls_ccm_encrypt_and_tag() argument
343 CCM_VALIDATE_RET( iv != NULL ); in mbedtls_ccm_encrypt_and_tag()
359 const unsigned char *iv, size_t iv_len, in mbedtls_ccm_star_auth_decrypt() argument
370 CCM_VALIDATE_RET( iv != NULL ); in mbedtls_ccm_star_auth_decrypt()
377 iv, iv_len, add, add_len, in mbedtls_ccm_star_auth_decrypt()
397 const unsigned char *iv, size_t iv_len, in mbedtls_ccm_auth_decrypt() argument
[all …]
A Dcamellia.c579 CAMELLIA_VALIDATE_RET( iv != NULL ); in mbedtls_camellia_crypt_cbc()
596 memcpy( iv, temp, 16 ); in mbedtls_camellia_crypt_cbc()
611 memcpy( iv, output, 16 ); in mbedtls_camellia_crypt_cbc()
631 unsigned char iv[16], in mbedtls_camellia_crypt_cfb128()
654 mbedtls_camellia_crypt_ecb( ctx, MBEDTLS_CAMELLIA_ENCRYPT, iv, iv ); in mbedtls_camellia_crypt_cfb128()
658 iv[n] = (unsigned char) c; in mbedtls_camellia_crypt_cfb128()
668 mbedtls_camellia_crypt_ecb( ctx, MBEDTLS_CAMELLIA_ENCRYPT, iv, iv ); in mbedtls_camellia_crypt_cfb128()
670 iv[n] = *output++ = (unsigned char)( iv[n] ^ *input++ ); in mbedtls_camellia_crypt_cfb128()
938 unsigned char iv[16]; in mbedtls_camellia_self_test() local
1016 memcpy( iv , src, 16 ); in mbedtls_camellia_self_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/sober128/
A Dsober128_test.c22 unsigned char iv[4] = { 0x00, 0x00, 0x00, 0x00 }; in sober128_stream_test()
32 if ((err = sober128_stream_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; in sober128_stream_test()
40 if ((err = sober128_stream_memory(key, sizeof(key), iv, sizeof(iv), in sober128_stream_test()
/optee_os/core/arch/arm/crypto/
A Daes_armv8a_ce.c184 unsigned int block_count, void *iv) in crypto_accel_aes_cbc_enc() argument
188 assert(out && in && key && iv); in crypto_accel_aes_cbc_enc()
191 ce_aes_cbc_encrypt(out, in, key, round_count, block_count, iv); in crypto_accel_aes_cbc_enc()
197 unsigned int block_count, void *iv) in crypto_accel_aes_cbc_dec() argument
201 assert(out && in && key && iv); in crypto_accel_aes_cbc_dec()
204 ce_aes_cbc_decrypt(out, in, key, round_count, block_count, iv); in crypto_accel_aes_cbc_dec()
210 unsigned int block_count, void *iv) in crypto_accel_aes_ctr_be_enc() argument
214 assert(out && in && key && iv); in crypto_accel_aes_ctr_be_enc()
217 ce_aes_ctr_encrypt(out, in, key, round_count, block_count, iv, 1); in crypto_accel_aes_ctr_be_enc()
/optee_os/core/lib/libtomcrypt/src/misc/pbes/
A Dpbes.c25 unsigned char k[32], *iv; in pbes_decrypt() local
51 if (arg->iv != NULL) { in pbes_decrypt()
52 iv = arg->iv->data; in pbes_decrypt()
54 iv = k + klen; in pbes_decrypt()
61 if ((err = cbc_start(cid, iv, k, keylen, 0, &cbc)) != CRYPT_OK) goto LBL_ERROR; in pbes_decrypt()
/optee_os/core/drivers/
A Dzynqmp_huk.c27 uint8_t iv[ZYNQMP_EFUSE_MEM(DNA)] __aligned_efuse = { 0 }; in tee_otp_get_hw_unique_key() local
40 ret = zynqmp_efuse_read(iv, sizeof(iv), DNA, false); in tee_otp_get_hw_unique_key()
46 if (tee_hash_createdigest(TEE_ALG_SHA256, iv, ZYNQMP_EFUSE_LEN(DNA), in tee_otp_get_hw_unique_key()
79 tag, sizeof(tag), iv, in tee_otp_get_hw_unique_key()
97 tag, sizeof(tag), iv, in tee_otp_get_hw_unique_key()
A Dzynqmp_csu_aes.c66 void *tag, const void *iv) in aes_transfer_enc() argument
92 memcpy(iv_padded, iv, ZYNQMP_GCM_IV_SIZE); in aes_transfer_enc()
137 const void *tag, const void *iv) in aes_transfer_dec() argument
156 memcpy(iv_padded, iv, ZYNQMP_GCM_IV_SIZE); in aes_transfer_dec()
281 const void *iv, size_t iv_len, in zynqmp_csu_aes_decrypt_data() argument
306 if (!src || !dst || !tag || !iv) { in zynqmp_csu_aes_decrypt_data()
317 ret = aes_transfer_dec(src, dst, src_len, tag, iv); in zynqmp_csu_aes_decrypt_data()
333 const void *iv, size_t iv_len, in zynqmp_csu_aes_encrypt_data() argument
358 if (!src || !dst || !tag || !iv) { in zynqmp_csu_aes_encrypt_data()
369 ret = aes_transfer_enc(src, dst, dst_len, tag, iv); in zynqmp_csu_aes_encrypt_data()
/optee_os/core/mm/
A Dfobj.c27 uint32_t iv[3]; member
33 uint64_t iv; member
86 .iv = { (vaddr_t)state, state->iv >> 32, state->iv } in rwp_load_page()
89 if (!state->iv) { in rwp_load_page()
98 return internal_aes_gcm_dec(&rwp_ae_key, &iv, sizeof(iv), in rwp_load_page()
109 assert(state->iv + 1 > state->iv); in rwp_save_page()
111 state->iv++; in rwp_save_page()
119 iv.iv[0] = (vaddr_t)state; in rwp_save_page()
120 iv.iv[1] = state->iv >> 32; in rwp_save_page()
121 iv.iv[2] = state->iv; in rwp_save_page()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/salsa20/
A Dsalsa20_ivctr64.c29 int salsa20_ivctr64(salsa20_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counte… in salsa20_ivctr64() argument
32 LTC_ARGCHK(iv != NULL); in salsa20_ivctr64()
36 LOAD32L(st->input[6], iv + 0); in salsa20_ivctr64()
37 LOAD32L(st->input[7], iv + 4); in salsa20_ivctr64()
/optee_os/core/lib/libtomcrypt/src/stream/rabbit/
A Drabbit.c229 int rabbit_setiv(rabbit_state* st, const unsigned char *iv, unsigned long ivlen) in rabbit_setiv() argument
235 LTC_ARGCHK(iv != NULL || ivlen == 0); in rabbit_setiv()
239 if (iv && ivlen > 0) XMEMCPY(tmpiv, iv, ivlen); in rabbit_setiv()
358 unsigned char iv[] = { 0x28, 0x8F, 0xF6, 0x5D, 0xC4, 0x2B, 0x92, 0xF9 }; in rabbit_test()
372 if ((err = rabbit_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; in rabbit_test()
382 unsigned char iv[] = { 0x28, 0x8F, 0xF6, 0x5D, 0xC4, 0x2B, 0x92, 0xF9 }; in rabbit_test()
393 … if ((err = rabbit_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; in rabbit_test()
407 unsigned char iv[] = { 0x28, 0x8F, 0xF6, 0x5D, 0xC4, 0x2B, 0x92, 0xF9 }; in rabbit_test()
420 … if ((err = rabbit_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; in rabbit_test()
428 if ((err = rabbit_memory(k, sizeof(k), iv, sizeof(iv), in rabbit_test()
[all …]
/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/
A Dccm.h159 const unsigned char *iv, size_t iv_len,
207 const unsigned char *iv, size_t iv_len,
244 const unsigned char *iv, size_t iv_len,
289 const unsigned char *iv, size_t iv_len,
/optee_os/out/arm/export-ta_arm64/include/mbedtls/
A Dccm.h159 const unsigned char *iv, size_t iv_len,
207 const unsigned char *iv, size_t iv_len,
244 const unsigned char *iv, size_t iv_len,
289 const unsigned char *iv, size_t iv_len,
/optee_os/out/arm/export-ta_arm32/host_include/mbedtls/
A Dccm.h159 const unsigned char *iv, size_t iv_len,
207 const unsigned char *iv, size_t iv_len,
244 const unsigned char *iv, size_t iv_len,
289 const unsigned char *iv, size_t iv_len,
/optee_os/out/arm/export-ta_arm32/include/mbedtls/
A Dccm.h159 const unsigned char *iv, size_t iv_len,
207 const unsigned char *iv, size_t iv_len,
244 const unsigned char *iv, size_t iv_len,
289 const unsigned char *iv, size_t iv_len,
/optee_os/out/arm/export-ta_arm64/host_include/mbedtls/
A Dccm.h159 const unsigned char *iv, size_t iv_len,
207 const unsigned char *iv, size_t iv_len,
244 const unsigned char *iv, size_t iv_len,
289 const unsigned char *iv, size_t iv_len,

Completed in 55 milliseconds

1234567