Home
last modified time | relevance | path

Searched refs:k (Results 1 – 25 of 84) sorted by relevance

1234

/optee_os/core/lib/libtomcrypt/src/ciphers/
H A Dcamellia.c278 LOAD64H(skey->camellia.k[0], kA); in camellia_setup()
279 LOAD64H(skey->camellia.k[1], kA+8); in camellia_setup()
283 LOAD64H(skey->camellia.k[2], T+32); in camellia_setup()
284 LOAD64H(skey->camellia.k[3], T+40); in camellia_setup()
288 LOAD64H(skey->camellia.k[4], T+32); in camellia_setup()
289 LOAD64H(skey->camellia.k[5], T+40); in camellia_setup()
298 LOAD64H(skey->camellia.k[6], T+32); in camellia_setup()
299 LOAD64H(skey->camellia.k[7], T+40); in camellia_setup()
303 LOAD64H(skey->camellia.k[8], T+32); in camellia_setup()
305 LOAD64H(skey->camellia.k[9], T+40); in camellia_setup()
[all …]
H A Dtea.c44 LOAD32H(skey->tea.k[0], key+0); in tea_setup()
45 LOAD32H(skey->tea.k[1], key+4); in tea_setup()
46 LOAD32H(skey->tea.k[2], key+8); in tea_setup()
47 LOAD32H(skey->tea.k[3], key+12); in tea_setup()
73 y += ((z<<4) + skey->tea.k[0]) ^ (z + sum) ^ ((z>>5) + skey->tea.k[1]); in tea_ecb_encrypt()
74 z += ((y<<4) + skey->tea.k[2]) ^ (y + sum) ^ ((y>>5) + skey->tea.k[3]); in tea_ecb_encrypt()
102 v1 -= ((v0 << 4) + skey->tea.k[2]) ^ (v0 + sum) ^ ((v0 >> 5) + skey->tea.k[3]); in tea_ecb_decrypt()
103 v0 -= ((v1 << 4) + skey->tea.k[0]) ^ (v1 + sum) ^ ((v1 >> 5) + skey->tea.k[1]); in tea_ecb_decrypt()
H A Dmulti2.c17 static void s_pi2(ulong32 *p, const ulong32 *k) in s_pi2() argument
20 t = (p[1] + k[0]) & 0xFFFFFFFFUL; in s_pi2()
26 static void s_pi3(ulong32 *p, const ulong32 *k) in s_pi3() argument
29 t = p[0] + k[1]; in s_pi3()
32 t = (t + k[2]) & 0xFFFFFFFFUL; in s_pi3()
38 static void s_pi4(ulong32 *p, const ulong32 *k) in s_pi4() argument
41 t = (p[1] + k[3]) & 0xFFFFFFFFUL; in s_pi4()
46 static void s_setup(const ulong32 *dk, const ulong32 *k, ulong32 *uk) in s_setup() argument
56 s_pi2(p, k); in s_setup()
58 s_pi3(p, k); in s_setup()
[all …]
H A Dserpent.c426 a ^= k[4 * r + 0]; \
427 b ^= k[4 * r + 1]; \
428 c ^= k[4 * r + 2]; \
429 d ^= k[4 * r + 3]; \
433 a = k[(8-r)*4 + 0]; \
434 b = k[(8-r)*4 + 1]; \
435 c = k[(8-r)*4 + 2]; \
436 d = k[(8-r)*4 + 3]; \
440 k[(8-r)*4 + 4] = a; \
441 k[(8-r)*4 + 5] = b; \
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/
H A Dpk_oid_str.c48 unsigned long j, k; in pk_oid_num_to_str() local
55 for (i = oidlen - 1, k = 0; i >= 0; i--) { in pk_oid_num_to_str()
58 tmp[k] = '0'; in pk_oid_num_to_str()
59 if (++k >= sizeof(tmp)) return CRYPT_ERROR; in pk_oid_num_to_str()
63 tmp[k] = '0' + (j % 10); in pk_oid_num_to_str()
64 if (++k >= sizeof(tmp)) return CRYPT_ERROR; in pk_oid_num_to_str()
69 tmp[k] = '.'; in pk_oid_num_to_str()
70 if (++k >= sizeof(tmp)) return CRYPT_ERROR; in pk_oid_num_to_str()
73 if (*outlen < k + 1) { in pk_oid_num_to_str()
74 *outlen = k + 1; in pk_oid_num_to_str()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/chacha/
H A Dchacha_test.c21 …unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0… in chacha_test()
39 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test()
49 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test()
55 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test()
61 if ((err = chacha_memory(k, sizeof(k), 20, in chacha_test()
66 if ((err = chacha_memory(k, sizeof(k), 20, in chacha_test()
/optee_os/lib/libutils/isoc/newlib/
H A Dstr-two-way.h129 size_t k; /* Offset into current period. */ in critical_factorization() local
145 k = p = 1; in critical_factorization()
146 while (j + k < needle_len) in critical_factorization()
148 a = CANON_ELEMENT (needle[j + k]); in critical_factorization()
149 b = CANON_ELEMENT (needle[(size_t)(max_suffix + k)]); in critical_factorization()
153 j += k; in critical_factorization()
154 k = 1; in critical_factorization()
160 if (k != p) in critical_factorization()
161 ++k; in critical_factorization()
165 k = 1; in critical_factorization()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
H A Dgcm_mult_h_arm_ce.c21 uint64_t k[2]; in gcm_mult_h() local
29 k[0] = (a << 1) | (b >> 63); in gcm_mult_h()
30 k[1] = (b << 1) | (a >> 63); in gcm_mult_h()
32 k[1] ^= 0xc200000000000000UL; in gcm_mult_h()
39 pmull_ghash_update_p64(1, dg, zeroes, k, NULL); in gcm_mult_h()
41 pmull_ghash_update_p8(1, dg, zeroes, k, NULL); in gcm_mult_h()
/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/
H A Dchacha20poly1305_test.c14 …unsigned char k[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x… in chacha20poly1305_test()
37 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
54 if ((err = chacha20poly1305_init(&st2, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
67 …if ((err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), (unsigned cha… in chacha20poly1305_test()
75 if ((err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), in chacha20poly1305_test()
80 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
91 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
102 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
110 if ((err = chacha20poly1305_init(&st2, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/
H A Dsosemanuk_test.c17 …unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0… in sosemanuk_test()
27 …if ((err = sosemanuk_setup(&st, k, sizeof(k))) != CRYPT_OK) return … in sosemanuk_test()
36 if ((err = sosemanuk_setup(&st, k, sizeof(k))) != CRYPT_OK) return err; in sosemanuk_test()
42 if ((err = sosemanuk_memory(k, sizeof(k), n, sizeof(n), in sosemanuk_test()
/optee_os/core/lib/libtomcrypt/src/stream/salsa20/
H A Dsalsa20_test.c20 …unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x… in salsa20_test()
40 …if ((err = salsa20_setup(&st, k, sizeof(k), rounds)) != CRYPT_OK) return er… in salsa20_test()
51 if ((err = salsa20_setup(&st, k, sizeof(k), rounds)) != CRYPT_OK) return err; in salsa20_test()
57 if ((err = salsa20_memory(k, sizeof(k), rounds, n, sizeof(n), counter, in salsa20_test()
/optee_os/core/lib/libtomcrypt/src/misc/pbes/
H A Dpbes.c18 unsigned char k[32], *iv; in pbes_decrypt() local
47 iv = k + klen; in pbes_decrypt()
51 if (klen > sizeof(k)) return CRYPT_INVALID_ARG; in pbes_decrypt()
53 …->pwd, arg->pwdlen, arg->salt->data, arg->salt->size, arg->iterations, hid, k, &klen)) != CRYPT_OK… in pbes_decrypt()
54 if ((err = cbc_start(cid, iv, k, keylen, 0, &cbc)) != CRYPT_OK) goto LBL_ERROR; in pbes_decrypt()
68 zeromem(k, sizeof(k)); in pbes_decrypt()
/optee_os/core/lib/libtomcrypt/src/pk/dsa/
H A Ddsa_sign_hash.c27 void *k, *kinv, *tmp; in dsa_sign_hash_raw() local
54 …if ((err = mp_init_multi(&k, &kinv, &tmp, LTC_NULL)) != CRYPT_OK) { goto ERRBUF;… in dsa_sign_hash_raw()
61 … if ((err = rand_bn_bits(k, qbits, prng, wprng)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
64 … if (mp_cmp_d(k, 0) != LTC_MP_GT || mp_cmp(k, key->q) != LTC_MP_LT) { goto retry; } in dsa_sign_hash_raw()
67 … if ((err = mp_gcd(k, key->q, tmp)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
71 …if ((err = mp_invmod(k, key->q, kinv)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
74 …if ((err = mp_exptmod(key->g, k, key->p, r)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
92 mp_clear_multi(k, kinv, tmp, LTC_NULL); in dsa_sign_hash_raw()
/optee_os/core/lib/libtomcrypt/src/pk/dh/
H A Ddh_export_key.c19 void *k; in dh_export_key() local
25 k = (type == PK_PRIVATE) ? key->x : key->y; in dh_export_key()
26 len = mp_unsigned_bin_size(k); in dh_export_key()
34 return mp_to_unsigned_bin(k, out); in dh_export_key()
/optee_os/core/lib/libtomcrypt/src/hashes/
H A Dmd2.c68 int j, k; in s_md2_compress() local
81 for (k = 0; k < 48; k++) { in s_md2_compress()
82 t = (md->md2.X[k] ^= PI_SUBST[(int)(t & 255)]); in s_md2_compress()
145 unsigned long i, k; in md2_done() local
156 k = 16 - md->md2.curlen; in md2_done()
158 md->md2.buf[i] = (unsigned char)k; in md2_done()
/optee_os/core/arch/arm/crypto/
H A Daes-gcm-ce.c35 static void ghash_reflect(uint64_t h[2], const uint64_t k[2]) in ghash_reflect()
37 uint64_t b = get_be64(k); in ghash_reflect()
38 uint64_t a = get_be64(k + 1); in ghash_reflect()
49 uint64_t k[2] = { 0 }; in internal_aes_gcm_set_key() local
53 enc_key->rounds, state->ctr, k); in internal_aes_gcm_set_key()
55 ghash_reflect(state->ghash_key.h, k); in internal_aes_gcm_set_key()
57 internal_aes_gcm_gfmul(k, k, h); in internal_aes_gcm_set_key()
60 internal_aes_gcm_gfmul(k, h, h); in internal_aes_gcm_set_key()
63 internal_aes_gcm_gfmul(k, h, h); in internal_aes_gcm_set_key()
/optee_os/core/lib/libtomcrypt/src/ciphers/twofish/
H A Dtwofish.c238 static void h_func(const unsigned char *in, unsigned char *out, const unsigned char *M, int k, int … in h_func() argument
245 switch (k) { in h_func()
346 int k, x, y; in s_twofish_setup() local
363 k = keylen / 8; in s_twofish_setup()
372 for (x = 0; x < k; x++) { in s_twofish_setup()
376 for (x = 0; x < k; x++) { in s_twofish_setup()
387 h_func(tmp, tmp2, M, k, 0); in s_twofish_setup()
394 h_func(tmp, tmp2, M, k, 1); in s_twofish_setup()
407 if (k == 2) { in s_twofish_setup()
416 } else if (k == 3) { in s_twofish_setup()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Decc_set_key.c23 if ((err = mp_read_unsigned_bin(key->k, (unsigned char *)in, inlen)) != CRYPT_OK) { in ecc_set_key()
26 if (mp_iszero(key->k) || (mp_cmp(key->k, key->dp.order) != LTC_MP_LT)) { in ecc_set_key()
31 …if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, a, prime, 1)) != CRYPT_OK) … in ecc_set_key()
/optee_os/core/lib/libtomcrypt/
H A Dsm2-dsa.c29 void *k = NULL; in sm2_ltc_dsa_sign() local
40 ltc_res = mp_init_multi(&k, &e, &r, &s, &tmp, NULL); in sm2_ltc_dsa_sign()
62 ltc_res = rand_bn_upto(k, ltc_key.dp.order, NULL, in sm2_ltc_dsa_sign()
71 ltc_res = ltc_ecc_mulmod(k, &ltc_key.dp.base, x1y1p, ltc_key.dp.A, in sm2_ltc_dsa_sign()
86 ltc_res = mp_add(r, k, tmp); in sm2_ltc_dsa_sign()
97 ltc_res = mp_add_d(ltc_key.k, 1, s); in sm2_ltc_dsa_sign()
107 ltc_res = mp_mul(r, ltc_key.k, tmp); in sm2_ltc_dsa_sign()
112 ltc_res = mp_sub(k, tmp, tmp); in sm2_ltc_dsa_sign()
132 mp_clear_multi(k, e, r, s, tmp, NULL); in sm2_ltc_dsa_sign()
/optee_os/lib/libmbedtls/mbedtls/library/
H A Daria.c275 const uint32_t k[4], const uint32_t x[4]) in aria_fo_xor()
279 a = p[0] ^ k[0]; in aria_fo_xor()
280 b = p[1] ^ k[1]; in aria_fo_xor()
281 c = p[2] ^ k[2]; in aria_fo_xor()
282 d = p[3] ^ k[3]; in aria_fo_xor()
297 const uint32_t k[4], const uint32_t x[4]) in aria_fe_xor()
301 a = p[0] ^ k[0]; in aria_fe_xor()
302 b = p[1] ^ k[1]; in aria_fe_xor()
303 c = p[2] ^ k[2]; in aria_fe_xor()
304 d = p[3] ^ k[3]; in aria_fe_xor()
[all …]
/optee_os/core/crypto/
H A Dsm4.c143 uint32_t k[36]; in sm4_setkey() local
151 k[0] = MK[0] ^ FK[0]; in sm4_setkey()
152 k[1] = MK[1] ^ FK[1]; in sm4_setkey()
153 k[2] = MK[2] ^ FK[2]; in sm4_setkey()
154 k[3] = MK[3] ^ FK[3]; in sm4_setkey()
157 k[i + 4] = k[i] ^ sm4CalciRK(k[i + 1] ^ k[i + 2] ^ k[i + 3] ^ in sm4_setkey()
159 SK[i] = k[i + 4]; in sm4_setkey()
/optee_os/core/lib/libtomcrypt/src/modes/xts/
H A Dxts_test.c198 int i, j, k, err, idx; in xts_test()
207 for (k = 0; k < 4; ++k) { in xts_test()
210 if (k & 0x1) { in xts_test()
213 if (k & 0x2) { in xts_test()
225 if ((k > 0) && (j == 1)) { in xts_test()
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/bit/
H A Dder_encode_raw_bit_string.c13 #define getbit(n, k) (((n) & ( 1 << (k) )) >> (k)) argument
/optee_os/core/lib/libtomcrypt/src/stream/sober128/
H A Dsober128_stream.c115 #define ADDKEY(k) \ argument
116 st->R[KEYP] += (k);
155 ulong32 i, k; in sober128_stream_setup() local
175 k = BYTE2WORD((unsigned char *)&key[i]); in sober128_stream_setup()
176 ADDKEY(k); in sober128_stream_setup()
202 ulong32 i, k; in sober128_stream_setiv() local
217 k = BYTE2WORD((unsigned char *)&iv[i]); in sober128_stream_setiv()
218 ADDKEY(k); in sober128_stream_setiv()
/optee_os/lib/libmbedtls/core/
H A Dsm2-dsa.c33 mbedtls_mpi k = { }; in sm2_mbedtls_dsa_sign() local
44 mbedtls_mpi_init(&k); in sm2_mbedtls_dsa_sign()
67 res = mbed_gen_random_upto(&k, &grp.N); in sm2_mbedtls_dsa_sign()
75 mres = mbedtls_ecp_mul(&grp, &x1y1p, &k, &grp.G, mbd_rand, in sm2_mbedtls_dsa_sign()
92 mres = mbedtls_mpi_add_mpi(&tmp, &r, &k); in sm2_mbedtls_dsa_sign()
112 mres = mbedtls_mpi_sub_mpi(&tmp, &k, &tmp); in sm2_mbedtls_dsa_sign()
137 mbedtls_mpi_free(&k); in sm2_mbedtls_dsa_sign()

1234