Home
last modified time | relevance | path

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

123

/optee_os/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.c150 static const uint32_t K[] = variable
188 #define P(a,b,c,d,e,f,g,h,x,K) \ argument
222 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); in mbedtls_internal_sha256_process()
257 local.A[5], local.A[6], local.A[7], R(i+0), K[i+0] ); in mbedtls_internal_sha256_process()
259 local.A[4], local.A[5], local.A[6], R(i+1), K[i+1] ); in mbedtls_internal_sha256_process()
261 local.A[3], local.A[4], local.A[5], R(i+2), K[i+2] ); in mbedtls_internal_sha256_process()
263 local.A[2], local.A[3], local.A[4], R(i+3), K[i+3] ); in mbedtls_internal_sha256_process()
265 local.A[1], local.A[2], local.A[3], R(i+4), K[i+4] ); in mbedtls_internal_sha256_process()
267 local.A[0], local.A[1], local.A[2], R(i+5), K[i+5] ); in mbedtls_internal_sha256_process()
269 local.A[7], local.A[0], local.A[1], R(i+6), K[i+6] ); in mbedtls_internal_sha256_process()
[all …]
A Dsha512.c187 static const uint64_t K[80] = variable
256 #define P(a,b,c,d,e,f,g,h,x,K) \ in mbedtls_internal_sha512_process() argument
259 local.temp1 = (h) + S3(e) + F1((e),(f),(g)) + (K) + (x); \ in mbedtls_internal_sha512_process()
281 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); in mbedtls_internal_sha512_process()
305 local.A[5], local.A[6], local.A[7], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
307 local.A[4], local.A[5], local.A[6], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
309 local.A[3], local.A[4], local.A[5], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
311 local.A[2], local.A[3], local.A[4], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
313 local.A[1], local.A[2], local.A[3], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
315 local.A[0], local.A[1], local.A[2], local.W[i], K[i] ); i++; in mbedtls_internal_sha512_process()
[all …]
A Ddhm.c430 MBEDTLS_MPI_CHK( mbedtls_mpi_exp_mod( &ctx->K, &GYb, &ctx->X, in mbedtls_dhm_calc_secret()
436 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &ctx->K, &ctx->K, &ctx->Vf ) ); in mbedtls_dhm_calc_secret()
437 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &ctx->K, &ctx->K, &ctx->P ) ); in mbedtls_dhm_calc_secret()
442 *olen = mbedtls_mpi_size( &ctx->K ); in mbedtls_dhm_calc_secret()
443 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &ctx->K, output, *olen ) ); in mbedtls_dhm_calc_secret()
466 mbedtls_mpi_free( &ctx->K ); in mbedtls_dhm_free()
/optee_os/core/lib/libtomcrypt/src/ciphers/safer/
A Dsaferp.c48 b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \
49 b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \
50 b[2] = safer_lbox[(b[2] + skey->saferp.K[i][2]) & 255] ^ skey->saferp.K[i+1][2]; \
51 b[3] = (safer_ebox[(b[3] ^ skey->saferp.K[i][3]) & 255] + skey->saferp.K[i+1][3]) & 255; \
52 b[4] = (safer_ebox[(b[4] ^ skey->saferp.K[i][4]) & 255] + skey->saferp.K[i+1][4]) & 255; \
53 b[5] = safer_lbox[(b[5] + skey->saferp.K[i][5]) & 255] ^ skey->saferp.K[i+1][5]; \
54 b[6] = safer_lbox[(b[6] + skey->saferp.K[i][6]) & 255] ^ skey->saferp.K[i+1][6]; \
55 b[7] = (safer_ebox[(b[7] ^ skey->saferp.K[i][7]) & 255] + skey->saferp.K[i+1][7]) & 255; \
56 b[8] = (safer_ebox[(b[8] ^ skey->saferp.K[i][8]) & 255] + skey->saferp.K[i+1][8]) & 255; \
57 b[9] = safer_lbox[(b[9] + skey->saferp.K[i][9]) & 255] ^ skey->saferp.K[i+1][9]; \
[all …]
/optee_os/core/lib/libtomcrypt/src/ciphers/
A Dcast5.c551 L ^= FI(R, skey->cast5.K[0], skey->cast5.K[16]); in _cast5_ecb_encrypt()
552 R ^= FII(L, skey->cast5.K[1], skey->cast5.K[17]); in _cast5_ecb_encrypt()
554 R ^= FI(L, skey->cast5.K[3], skey->cast5.K[19]); in _cast5_ecb_encrypt()
555 L ^= FII(R, skey->cast5.K[4], skey->cast5.K[20]); in _cast5_ecb_encrypt()
557 L ^= FI(R, skey->cast5.K[6], skey->cast5.K[22]); in _cast5_ecb_encrypt()
558 R ^= FII(L, skey->cast5.K[7], skey->cast5.K[23]); in _cast5_ecb_encrypt()
560 R ^= FI(L, skey->cast5.K[9], skey->cast5.K[25]); in _cast5_ecb_encrypt()
612 R ^= FI(L, skey->cast5.K[9], skey->cast5.K[25]); in _cast5_ecb_decrypt()
615 L ^= FI(R, skey->cast5.K[6], skey->cast5.K[22]); in _cast5_ecb_decrypt()
618 R ^= FI(L, skey->cast5.K[3], skey->cast5.K[19]); in _cast5_ecb_decrypt()
[all …]
A Drc5.c78 S = skey->rc5.K; in _rc5_setup()
134 const ulong32 *K; in _rc5_ecb_encrypt() local
142 A += skey->rc5.K[0]; in _rc5_ecb_encrypt()
144 K = skey->rc5.K + 2; in _rc5_ecb_encrypt()
152 K += 4; in _rc5_ecb_encrypt()
158 K += 2; in _rc5_ecb_encrypt()
190 const ulong32 *K; in _rc5_ecb_decrypt() local
198 K = skey->rc5.K + (skey->rc5.rounds << 1); in _rc5_ecb_decrypt()
201 K -= 2; in _rc5_ecb_decrypt()
207 K -= 4; in _rc5_ecb_decrypt()
[all …]
A Drc6.c128 const ulong32 *K; in _rc6_ecb_encrypt() local
136 b += skey->rc6.K[0]; in _rc6_ecb_encrypt()
137 d += skey->rc6.K[1]; in _rc6_ecb_encrypt()
143 c = ROL(c^u,t) + K[1]; K += 2; in _rc6_ecb_encrypt()
145 K = skey->rc6.K + 2; in _rc6_ecb_encrypt()
155 a += skey->rc6.K[42]; in _rc6_ecb_encrypt()
183 const ulong32 *K; in _rc6_ecb_decrypt() local
198 a = ROR(a - K[0], u) ^ t; K -= 2; in _rc6_ecb_decrypt()
200 K = skey->rc6.K + 40; in _rc6_ecb_decrypt()
211 b -= skey->rc6.K[0]; in _rc6_ecb_decrypt()
[all …]
A Dblowfish.c335 skey->blowfish.K[x] = ORIG_P[x] ^ A; in blowfish_setup()
354 LOAD32H(skey->blowfish.K[x], &B[0]); in blowfish_setup()
355 LOAD32H(skey->blowfish.K[x+1], &B[4]); in blowfish_setup()
425 R ^= skey->blowfish.K[17]; in _blowfish_ecb_encrypt()
426 L ^= skey->blowfish.K[16]; in _blowfish_ecb_encrypt()
479 R ^= skey->blowfish.K[17]; in _blowfish_ecb_decrypt()
480 L ^= skey->blowfish.K[16]; in _blowfish_ecb_decrypt()
484 L ^= F(R); R ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
485 R ^= F(L); L ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
486 L ^= F(R); R ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
[all …]
A Dkseed.c221 skey->kseed.K[2*i+0] = G(k1 + k3 - KCi[i]); in kseed_setup()
222 skey->kseed.K[2*i+1] = G(k2 - k4 + KCi[i]); in kseed_setup()
233 skey->kseed.dK[2*(15-i)+0] = skey->kseed.K[2*i+0]; in kseed_setup()
234 skey->kseed.dK[2*(15-i)+1] = skey->kseed.K[2*i+1]; in kseed_setup()
240 static void rounds(ulong32 *P, const ulong32 *K) in rounds() argument
245 F(P[0], P[1], P[2], P[3], K[0], K[1]); in rounds()
246 F(P[2], P[3], P[0], P[1], K[2], K[3]); in rounds()
247 K += 4; in rounds()
265 rounds(P, skey->kseed.K); in kseed_ecb_encrypt()
A Dxtea.c35 ulong32 x, sum, K[4]; in xtea_setup() local
50 LOAD32H(K[0], key+0); in xtea_setup()
51 LOAD32H(K[1], key+4); in xtea_setup()
52 LOAD32H(K[2], key+8); in xtea_setup()
53 LOAD32H(K[3], key+12); in xtea_setup()
56 skey->xtea.A[x] = (sum + K[sum&3]) & 0xFFFFFFFFUL; in xtea_setup()
58 skey->xtea.B[x] = (sum + K[(sum>>11)&3]) & 0xFFFFFFFFUL; in xtea_setup()
62 zeromem(&K, sizeof(K)); in xtea_setup()
A Dnoekeon.c89 LOAD32H(skey->noekeon.K[0],&key[0]); in noekeon_setup()
90 LOAD32H(skey->noekeon.K[1],&key[4]); in noekeon_setup()
91 LOAD32H(skey->noekeon.K[2],&key[8]); in noekeon_setup()
92 LOAD32H(skey->noekeon.K[3],&key[12]); in noekeon_setup()
129 THETA(skey->noekeon.K, a,b,c,d); \ in _noekeon_ecb_encrypt()
141 THETA(skey->noekeon.K, a, b, c, d); in _noekeon_ecb_encrypt()
/optee_os/core/lib/libtomcrypt/src/hashes/whirl/
A Dwhirl.c62 ulong64 K[2][8], T[3][8]; in _whirlpool_compress() local
67 K[0][x] = md->whirlpool.state[x]; in _whirlpool_compress()
71 T[0][x] ^= K[0][x]; in _whirlpool_compress()
79 K[1][y] = theta_pi_gamma(K[0], y); in _whirlpool_compress()
82 K[1][0] ^= cont[x]; in _whirlpool_compress()
86 T[1][y] = theta_pi_gamma(T[0], y) ^ K[1][y]; in _whirlpool_compress()
92 K[0][y] = theta_pi_gamma(K[1], y); in _whirlpool_compress()
95 K[0][0] ^= cont[x+1]; in _whirlpool_compress()
99 T[0][y] = theta_pi_gamma(T[1], y) ^ K[0][y]; in _whirlpool_compress()
/optee_os/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_init.c57 XMEMCPY(xcbc->K[0], key, k1); in xcbc_init()
58 XMEMCPY(xcbc->K[1], key+k1, cipher_descriptor[cipher]->block_length); in xcbc_init()
59 …XMEMCPY(xcbc->K[2], key+k1 + cipher_descriptor[cipher]->block_length, cipher_descriptor[cipher]->b… in xcbc_init()
77 xcbc->K[y][x] = y + 1; in xcbc_init()
79 cipher_descriptor[cipher]->ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init()
84 err = cipher_descriptor[cipher]->setup(xcbc->K[0], k1, 0, &xcbc->key); in xcbc_init()
A Dxcbc_test.c29 unsigned char K[16], M[34], T[16]; in xcbc_test()
110 …if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK)… in xcbc_test()
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
A Docb3_test.c184 const unsigned char K[] = { 0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08, in ocb3_test()
255 K, sizeof(K), in ocb3_test()
269 K, sizeof(K), in ocb3_test()
285 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test()
293 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test()
/optee_os/core/lib/libtomcrypt/src/ciphers/twofish/
A Dtwofish.c497 a ^= skey->twofish.K[0]; in _twofish_ecb_encrypt()
498 b ^= skey->twofish.K[1]; in _twofish_ecb_encrypt()
499 c ^= skey->twofish.K[2]; in _twofish_ecb_encrypt()
500 d ^= skey->twofish.K[3]; in _twofish_ecb_encrypt()
502 k = skey->twofish.K + 8; in _twofish_ecb_encrypt()
517 ta = c ^ skey->twofish.K[4]; in _twofish_ecb_encrypt()
579 k = skey->twofish.K + 36; in _twofish_ecb_decrypt()
594 a ^= skey->twofish.K[0]; in _twofish_ecb_decrypt()
595 b ^= skey->twofish.K[1]; in _twofish_ecb_decrypt()
596 c ^= skey->twofish.K[2]; in _twofish_ecb_decrypt()
[all …]
/optee_os/core/lib/libtomcrypt/src/prngs/
A Dfortuna.c123 if ((err = sha256_process(&md, prng->u.fortuna.K, 32)) != CRYPT_OK) { in _fortuna_reseed()
153 if ((err = sha256_done(&md, prng->u.fortuna.K)) != CRYPT_OK) { in _fortuna_reseed()
156 if ((err = rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey)) != CRYPT_OK) { in _fortuna_reseed()
196 if ((err = sha256_process(&md, prng->u.fortuna.K, 32)) != CRYPT_OK) { in fortuna_update_seed()
205 if ((err = sha256_done(&md, prng->u.fortuna.K)) != CRYPT_OK) { in fortuna_update_seed()
245 zeromem(prng->u.fortuna.K, 32); in fortuna_start()
246 if ((err = rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey)) != CRYPT_OK) { in fortuna_start()
419 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K , &prng->u.fortuna.skey); in fortuna_read()
422 rijndael_ecb_encrypt(prng->u.fortuna.IV, prng->u.fortuna.K+16, &prng->u.fortuna.skey); in fortuna_read()
425 if (rijndael_setup(prng->u.fortuna.K, 32, 0, &prng->u.fortuna.skey) != CRYPT_OK) { in fortuna_read()
/optee_os/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_done.c38 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_done()
47 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->ctr, ccm->CTRPAD, &ccm->K)) != CRYPT_O… in ccm_done()
51 cipher_descriptor[ccm->cipher]->done(&ccm->K); in ccm_done()
A Dccm_add_aad.c39 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_add_aad()
50 …if ((err = cipher_descriptor[ccm->cipher]->ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { in ccm_add_aad()
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_test.c29 unsigned char K[32]; in gcm_test()
342 if ((err = gcm_init(&gcm, idx, tests[0].K, tests[0].keylen)) != CRYPT_OK) return err; in gcm_test()
350 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
368 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
A Dgcm_process.c74 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
103 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
121 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
139 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process()
/optee_os/core/lib/libtomcrypt/src/mac/pelican/
A Dpelican.c44 if ((err = aes_setup(key, keylen, 0, &pelmac->K)) != CRYPT_OK) { in pelican_init()
49 aes_ecb_encrypt(pelmac->state, pelmac->state, &pelmac->K); in pelican_init()
156 aes_ecb_encrypt(pelmac->state, out, &pelmac->K); in pelican_done()
157 aes_done(&pelmac->K); in pelican_done()
A Dpelican_test.c25 unsigned char K[32], MSG[64], T[16]; in pelican_test()
91 if ((err = pelican_init(&pel, tests[x].K, tests[x].keylen)) != CRYPT_OK) { in pelican_test()
/optee_os/core/lib/libtomcrypt/src/mac/f9/
A Df9_test.c29 unsigned char K[16], M[128], T[4]; in f9_test()
60 … if ((err = f9_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { in f9_test()

Completed in 31 milliseconds

123