Home
last modified time | relevance | path

Searched refs:K (Results 1 – 25 of 51) sorted by relevance

123

/optee_os-3.20.0/lib/libmbedtls/mbedtls/library/
A Drsa_internal.c140 MBEDTLS_MPI_CHK( mbedtls_mpi_exp_mod( &K, &K, &T, N, in mbedtls_rsa_deduce_primes()
151 MBEDTLS_MPI_CHK( mbedtls_mpi_add_int( &K, &K, 1 ) ); in mbedtls_rsa_deduce_primes()
167 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &K, &K, &K ) ); in mbedtls_rsa_deduce_primes()
226 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &K, &K, &L ) ); in mbedtls_rsa_deduce_private_exponent()
227 MBEDTLS_MPI_CHK( mbedtls_mpi_div_mpi( &K, NULL, &K, D ) ); in mbedtls_rsa_deduce_private_exponent()
303 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &K, &K, 1 ) ); in mbedtls_rsa_validate_crt()
304 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &K, &K, P ) ); in mbedtls_rsa_validate_crt()
417 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &K, &K, 1 ) ); in mbedtls_rsa_validate_params()
419 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &K, &K, &L ) ); in mbedtls_rsa_validate_params()
428 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &K, &K, 1 ) ); in mbedtls_rsa_validate_params()
[all …]
A Dsha256.c127 static const uint32_t K[] = variable
165 #define P(a,b,c,d,e,f,g,h,x,K) \ argument
199 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); in mbedtls_internal_sha256_process()
234 local.A[5], local.A[6], local.A[7], R(i+0), K[i+0] ); in mbedtls_internal_sha256_process()
236 local.A[4], local.A[5], local.A[6], R(i+1), K[i+1] ); in mbedtls_internal_sha256_process()
238 local.A[3], local.A[4], local.A[5], R(i+2), K[i+2] ); in mbedtls_internal_sha256_process()
240 local.A[2], local.A[3], local.A[4], R(i+3), K[i+3] ); in mbedtls_internal_sha256_process()
242 local.A[1], local.A[2], local.A[3], R(i+4), K[i+4] ); in mbedtls_internal_sha256_process()
244 local.A[0], local.A[1], local.A[2], R(i+5), K[i+5] ); in mbedtls_internal_sha256_process()
246 local.A[7], local.A[0], local.A[1], R(i+6), K[i+6] ); in mbedtls_internal_sha256_process()
[all …]
A Dsha512.c156 static const uint64_t K[80] = variable
225 #define P(a,b,c,d,e,f,g,h,x,K) \ in mbedtls_internal_sha512_process() argument
228 local.temp1 = (h) + S3(e) + F1((e),(f),(g)) + (K) + (x); \ in mbedtls_internal_sha512_process()
250 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); in mbedtls_internal_sha512_process()
274 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
276 local.A[4], local.A[5], local.A[6], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
278 local.A[3], local.A[4], local.A[5], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
280 local.A[2], local.A[3], local.A[4], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
282 local.A[1], local.A[2], local.A[3], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
284 local.A[0], local.A[1], local.A[2], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/ciphers/safer/
A Dsaferp.c41 b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \
42 b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \
43 b[2] = safer_lbox[(b[2] + skey->saferp.K[i][2]) & 255] ^ skey->saferp.K[i+1][2]; \
44 b[3] = (safer_ebox[(b[3] ^ skey->saferp.K[i][3]) & 255] + skey->saferp.K[i+1][3]) & 255; \
45 b[4] = (safer_ebox[(b[4] ^ skey->saferp.K[i][4]) & 255] + skey->saferp.K[i+1][4]) & 255; \
46 b[5] = safer_lbox[(b[5] + skey->saferp.K[i][5]) & 255] ^ skey->saferp.K[i+1][5]; \
47 b[6] = safer_lbox[(b[6] + skey->saferp.K[i][6]) & 255] ^ skey->saferp.K[i+1][6]; \
48 b[7] = (safer_ebox[(b[7] ^ skey->saferp.K[i][7]) & 255] + skey->saferp.K[i+1][7]) & 255; \
49 b[8] = (safer_ebox[(b[8] ^ skey->saferp.K[i][8]) & 255] + skey->saferp.K[i+1][8]) & 255; \
50 b[9] = safer_lbox[(b[9] + skey->saferp.K[i][9]) & 255] ^ skey->saferp.K[i+1][9]; \
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/ciphers/
A Dcast5.c538 L ^= FI(R, skey->cast5.K[0], skey->cast5.K[16]); in s_cast5_ecb_encrypt()
539 R ^= FII(L, skey->cast5.K[1], skey->cast5.K[17]); in s_cast5_ecb_encrypt()
541 R ^= FI(L, skey->cast5.K[3], skey->cast5.K[19]); in s_cast5_ecb_encrypt()
542 L ^= FII(R, skey->cast5.K[4], skey->cast5.K[20]); in s_cast5_ecb_encrypt()
544 L ^= FI(R, skey->cast5.K[6], skey->cast5.K[22]); in s_cast5_ecb_encrypt()
545 R ^= FII(L, skey->cast5.K[7], skey->cast5.K[23]); in s_cast5_ecb_encrypt()
547 R ^= FI(L, skey->cast5.K[9], skey->cast5.K[25]); in s_cast5_ecb_encrypt()
599 R ^= FI(L, skey->cast5.K[9], skey->cast5.K[25]); in s_cast5_ecb_decrypt()
602 L ^= FI(R, skey->cast5.K[6], skey->cast5.K[22]); in s_cast5_ecb_decrypt()
605 R ^= FI(L, skey->cast5.K[3], skey->cast5.K[19]); in s_cast5_ecb_decrypt()
[all …]
A Drc5.c71 S = skey->rc5.K; in s_rc5_setup()
127 const ulong32 *K; in s_rc5_ecb_encrypt() local
139 A += skey->rc5.K[0]; in s_rc5_ecb_encrypt()
141 K = skey->rc5.K + 2; in s_rc5_ecb_encrypt()
149 K += 4; in s_rc5_ecb_encrypt()
155 K += 2; in s_rc5_ecb_encrypt()
187 const ulong32 *K; in s_rc5_ecb_decrypt() local
199 K = skey->rc5.K + (skey->rc5.rounds << 1); in s_rc5_ecb_decrypt()
202 K -= 2; in s_rc5_ecb_decrypt()
208 K -= 4; in s_rc5_ecb_decrypt()
[all …]
A Drc6.c121 const ulong32 *K; in s_rc6_ecb_encrypt() local
129 b += skey->rc6.K[0]; in s_rc6_ecb_encrypt()
130 d += skey->rc6.K[1]; in s_rc6_ecb_encrypt()
136 c = ROL(c^u,t) + K[1]; K += 2; in s_rc6_ecb_encrypt()
138 K = skey->rc6.K + 2; in s_rc6_ecb_encrypt()
148 a += skey->rc6.K[42]; in s_rc6_ecb_encrypt()
176 const ulong32 *K; in s_rc6_ecb_decrypt() local
191 a = ROR(a - K[0], u) ^ t; K -= 2; in s_rc6_ecb_decrypt()
193 K = skey->rc6.K + 40; in s_rc6_ecb_decrypt()
204 b -= skey->rc6.K[0]; in s_rc6_ecb_decrypt()
[all …]
A Dkseed.c214 skey->kseed.K[2*i+0] = G(k1 + k3 - KCi[i]); in kseed_setup()
215 skey->kseed.K[2*i+1] = G(k2 - k4 + KCi[i]); in kseed_setup()
226 skey->kseed.dK[2*(15-i)+0] = skey->kseed.K[2*i+0]; in kseed_setup()
227 skey->kseed.dK[2*(15-i)+1] = skey->kseed.K[2*i+1]; in kseed_setup()
233 static void rounds(ulong32 *P, const ulong32 *K) in rounds() argument
238 F(P[0], P[1], P[2], P[3], K[0], K[1]); in rounds()
239 F(P[2], P[3], P[0], P[1], K[2], K[3]); in rounds()
240 K += 4; in rounds()
258 rounds(P, skey->kseed.K); in kseed_ecb_encrypt()
A Dblowfish.c324 l ^= skey->blowfish.K[16]; in s_blowfish_encipher()
325 r ^= skey->blowfish.K[17]; in s_blowfish_encipher()
383 skey->blowfish.K[x] ^= A; in blowfish_expand()
398 skey->blowfish.K[x] = B[0]; in blowfish_expand()
399 skey->blowfish.K[x+1] = B[1]; in blowfish_expand()
543 R ^= skey->blowfish.K[17]; in s_blowfish_ecb_decrypt()
544 L ^= skey->blowfish.K[16]; in s_blowfish_ecb_decrypt()
548 L ^= F(R); R ^= skey->blowfish.K[r--]; in s_blowfish_ecb_decrypt()
549 R ^= F(L); L ^= skey->blowfish.K[r--]; in s_blowfish_ecb_decrypt()
550 L ^= F(R); R ^= skey->blowfish.K[r--]; in s_blowfish_ecb_decrypt()
[all …]
A Dxtea.c28 ulong32 x, sum, K[4]; in xtea_setup() local
43 LOAD32H(K[0], key+0); in xtea_setup()
44 LOAD32H(K[1], key+4); in xtea_setup()
45 LOAD32H(K[2], key+8); in xtea_setup()
46 LOAD32H(K[3], key+12); in xtea_setup()
49 skey->xtea.A[x] = (sum + K[sum&3]) & 0xFFFFFFFFUL; in xtea_setup()
51 skey->xtea.B[x] = (sum + K[(sum>>11)&3]) & 0xFFFFFFFFUL; in xtea_setup()
55 zeromem(&K, sizeof(K)); in xtea_setup()
/optee_os-3.20.0/core/lib/libtomcrypt/src/hashes/whirl/
A Dwhirl.c55 ulong64 K[2][8], T[3][8]; in ss_whirlpool_compress() local
60 K[0][x] = md->whirlpool.state[x]; in ss_whirlpool_compress()
64 T[0][x] ^= K[0][x]; in ss_whirlpool_compress()
72 K[1][y] = theta_pi_gamma(K[0], y); in ss_whirlpool_compress()
75 K[1][0] ^= cont[x]; in ss_whirlpool_compress()
79 T[1][y] = theta_pi_gamma(T[0], y) ^ K[1][y]; in ss_whirlpool_compress()
85 K[0][y] = theta_pi_gamma(K[1], y); in ss_whirlpool_compress()
88 K[0][0] ^= cont[x+1]; in ss_whirlpool_compress()
92 T[0][y] = theta_pi_gamma(T[1], y) ^ K[0][y]; in ss_whirlpool_compress()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_init.c50 XMEMCPY(xcbc->K[0], key, k1); in xcbc_init()
51 XMEMCPY(xcbc->K[1], key+k1, cipher_descriptor[cipher]->block_length); in xcbc_init()
52 …XMEMCPY(xcbc->K[2], key+k1 + cipher_descriptor[cipher]->block_length, cipher_descriptor[cipher]->b… in xcbc_init()
70 xcbc->K[y][x] = y + 1; in xcbc_init()
72 cipher_descriptor[cipher]->ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init()
77 err = cipher_descriptor[cipher]->setup(xcbc->K[0], k1, 0, &xcbc->key); in xcbc_init()
A Dxcbc_test.c22 unsigned char K[16], M[34], T[16]; in xcbc_test()
103 …if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK)… in xcbc_test()
A Dxcbc_done.c38 xcbc->IV[x] ^= xcbc->K[1][x]; in xcbc_done()
44 xcbc->IV[x] ^= xcbc->K[2][x]; in xcbc_done()
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/
A Docb3_test.c177 const unsigned char K[] = { 0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08, in ocb3_test()
248 K, sizeof(K), in ocb3_test()
262 K, sizeof(K), in ocb3_test()
278 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test()
286 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_done.c31 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_done()
40 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->ctr, ccm->CTRPAD, &ccm->K)) != CRYPT_O… in ccm_done()
44 cipher_descriptor[ccm->cipher]->done(&ccm->K); in ccm_done()
A Dccm_add_aad.c32 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_add_aad()
43 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_add_aad()
A Dccm_process.c50 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->ctr, ccm->CTRPAD, &ccm->K)) != CRYPT_O… in ccm_process()
66 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_process()
/optee_os-3.20.0/core/lib/libtomcrypt/src/ciphers/twofish/
A Dtwofish.c490 a ^= skey->twofish.K[0]; in s_twofish_ecb_encrypt()
491 b ^= skey->twofish.K[1]; in s_twofish_ecb_encrypt()
492 c ^= skey->twofish.K[2]; in s_twofish_ecb_encrypt()
493 d ^= skey->twofish.K[3]; in s_twofish_ecb_encrypt()
495 k = skey->twofish.K + 8; in s_twofish_ecb_encrypt()
510 ta = c ^ skey->twofish.K[4]; in s_twofish_ecb_encrypt()
572 k = skey->twofish.K + 36; in s_twofish_ecb_decrypt()
587 a ^= skey->twofish.K[0]; in s_twofish_ecb_decrypt()
588 b ^= skey->twofish.K[1]; in s_twofish_ecb_decrypt()
589 c ^= skey->twofish.K[2]; in s_twofish_ecb_decrypt()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/f9/
A Df9_test.c22 unsigned char K[16], M[128], T[4]; in f9_test()
53 … if ((err = f9_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { in f9_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pelican/
A Dpelican_test.c18 unsigned char K[32], MSG[64], T[16]; in pelican_test()
84 if ((err = pelican_init(&pel, tests[x].K, tests[x].keylen)) != CRYPT_OK) { in pelican_test()
A Dpelican.c37 if ((err = aes_setup(key, keylen, 0, &pelmac->K)) != CRYPT_OK) { in pelican_init()
42 aes_ecb_encrypt(pelmac->state, pelmac->state, &pelmac->K); in pelican_init()
149 aes_ecb_encrypt(pelmac->state, out, &pelmac->K); in pelican_done()
150 aes_done(&pelmac->K); in pelican_done()
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_test.c22 unsigned char K[32]; in gcm_test()
335 if ((err = gcm_init(&gcm, idx, tests[0].K, tests[0].keylen)) != CRYPT_OK) return err; in gcm_test()
343 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
361 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
A Dgcm_process.c67 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
96 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
114 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
132 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
/optee_os-3.20.0/core/lib/libtomcrypt/src/prngs/
A Dfortuna.c116 if ((err = sha256_process(&md, prng->u.fortuna.K, 32)) != CRYPT_OK) { in s_fortuna_reseed()
146 if ((err = sha256_done(&md, prng->u.fortuna.K)) != CRYPT_OK) { in s_fortuna_reseed()
149 if ((err = rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey)) != CRYPT_OK) { in s_fortuna_reseed()
189 if ((err = sha256_process(&md, prng->u.fortuna.K, 32)) != CRYPT_OK) { in fortuna_update_seed()
198 if ((err = sha256_done(&md, prng->u.fortuna.K)) != CRYPT_OK) { in fortuna_update_seed()
238 zeromem(prng->u.fortuna.K, 32); in fortuna_start()
239 if ((err = rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey)) != CRYPT_OK) { in fortuna_start()
412 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K , &prng->u.fortuna.skey); in fortuna_read()
415 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K+16, &prng->u.fortuna.skey); in fortuna_read()
418 if (rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey) != CRYPT_OK) { in fortuna_read()

Completed in 43 milliseconds

123