/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_add_aad.c | 33 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_add_aad() 48 gcm->X[x] ^= gcm->buf[x]; in gcm_add_aad() 52 gcm_mult_h(gcm, gcm->X); in gcm_add_aad() 59 gcm->X[x] ^= gcm->buf[x]; in gcm_add_aad() 61 gcm_mult_h(gcm, gcm->X); in gcm_add_aad() 64 XMEMCPY(gcm->Y, gcm->X, 16); in gcm_add_aad() 67 XMEMCPY(gcm->Y, gcm->buf, 12); in gcm_add_aad() 73 XMEMCPY(gcm->Y_0, gcm->Y, 16); in gcm_add_aad() 91 gcm_mult_h(gcm, gcm->X); in gcm_add_aad() 101 gcm->X[gcm->buflen++] ^= *adata++; in gcm_add_aad() [all …]
|
A D | gcm_process.c | 36 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_process() 58 gcm->totlen += gcm->buflen * CONST64(8); in gcm_process() 59 gcm_mult_h(gcm, gcm->X); in gcm_process() 67 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process() 91 gcm_mult_h(gcm, gcm->X); in gcm_process() 96 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process() 109 gcm_mult_h(gcm, gcm->X); in gcm_process() 114 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process() 126 gcm_mult_h(gcm, gcm->X); in gcm_process() 132 … if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_process() [all …]
|
A D | gcm_done.c | 29 if (gcm->buflen > 16 || gcm->buflen < 0) { in gcm_done() 52 if (gcm->buflen) { in gcm_done() 53 gcm->pttotlen += gcm->buflen * CONST64(8); in gcm_done() 54 gcm_mult_h(gcm, gcm->X); in gcm_done() 58 STORE64H(gcm->totlen, gcm->buf); in gcm_done() 59 STORE64H(gcm->pttotlen, gcm->buf+8); in gcm_done() 61 gcm->X[x] ^= gcm->buf[x]; in gcm_done() 63 gcm_mult_h(gcm, gcm->X); in gcm_done() 66 …if ((err = cipher_descriptor[gcm->cipher]->ecb_encrypt(gcm->Y_0, gcm->buf, &gcm->K)) != CRYPT_OK) { in gcm_done() 70 tag[x] = gcm->buf[x] ^ gcm->X[x]; in gcm_done() [all …]
|
A D | gcm_add_iv.c | 19 int gcm_add_iv(gcm_state *gcm, in gcm_add_iv() argument 25 LTC_ARGCHK(gcm != NULL); in gcm_add_iv() 35 if (gcm->buflen >= 16 || gcm->buflen < 0) { in gcm_add_iv() 46 gcm->ivmode |= 1; in gcm_add_iv() 51 if (gcm->buflen == 0) { in gcm_add_iv() 56 gcm_mult_h(gcm, gcm->X); in gcm_add_iv() 65 gcm->buf[gcm->buflen++] = *IV++; in gcm_add_iv() 70 gcm->X[y] ^= gcm->buf[y]; in gcm_add_iv() 72 gcm_mult_h(gcm, gcm->X); in gcm_add_iv() 73 gcm->buflen = 0; in gcm_add_iv() [all …]
|
A D | gcm_init.c | 29 LTC_ARGCHK(gcm != NULL); in gcm_init() 53 if ((err = cipher_descriptor[cipher]->ecb_encrypt(B, gcm->H, &gcm->K)) != CRYPT_OK) { in gcm_init() 58 zeromem(gcm->buf, sizeof(gcm->buf)); in gcm_init() 59 zeromem(gcm->X, sizeof(gcm->X)); in gcm_init() 60 gcm->cipher = cipher; in gcm_init() 62 gcm->ivmode = 0; in gcm_init() 63 gcm->buflen = 0; in gcm_init() 64 gcm->totlen = 0; in gcm_init() 65 gcm->pttotlen = 0; in gcm_init() 74 gcm_gf_mult(gcm->H, B, &gcm->PC[0][y][0]); in gcm_init() [all …]
|
A D | gcm_reset.c | 17 int gcm_reset(gcm_state *gcm) in gcm_reset() argument 19 LTC_ARGCHK(gcm != NULL); in gcm_reset() 21 zeromem(gcm->buf, sizeof(gcm->buf)); in gcm_reset() 22 zeromem(gcm->X, sizeof(gcm->X)); in gcm_reset() 23 gcm->mode = LTC_GCM_MODE_IV; in gcm_reset() 24 gcm->ivmode = 0; in gcm_reset() 25 gcm->buflen = 0; in gcm_reset() 26 gcm->totlen = 0; in gcm_reset() 27 gcm->pttotlen = 0; in gcm_reset()
|
A D | gcm_memory.c | 39 gcm_state *gcm; in gcm_memory() local 60 orig = gcm = XMALLOC(sizeof(*gcm)); in gcm_memory() 62 orig = gcm = XMALLOC(sizeof(*gcm) + 16); in gcm_memory() 64 if (gcm == NULL) { in gcm_memory() 73 if ((unsigned long)gcm & 15) { in gcm_memory() 74 gcm = (gcm_state *)((unsigned long)gcm + (16 - ((unsigned long)gcm & 15))); in gcm_memory() 78 if ((err = gcm_init(gcm, cipher, key, keylen)) != CRYPT_OK) { in gcm_memory() 81 if ((err = gcm_add_iv(gcm, IV, IVlen)) != CRYPT_OK) { in gcm_memory() 84 if ((err = gcm_add_aad(gcm, adata, adatalen)) != CRYPT_OK) { in gcm_memory() 91 if ((err = gcm_done(gcm, tag, taglen)) != CRYPT_OK) { in gcm_memory() [all …]
|
A D | gcm_mult_h.c | 16 void gcm_mult_h(const gcm_state *gcm, unsigned char *I) in gcm_mult_h() argument 22 asm("movdqa (%0),%%xmm0"::"r"(&gcm->PC[0][I[0]][0])); in gcm_mult_h() 24 asm("pxor (%0),%%xmm0"::"r"(&gcm->PC[x][I[x]][0])); in gcm_mult_h() 29 XMEMCPY(T, &gcm->PC[0][I[0]][0], 16); in gcm_mult_h() 33 *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&gcm->PC[x][I[x]][y])); in gcm_mult_h() 37 T[y] ^= gcm->PC[x][I[x]][y]; in gcm_mult_h() 43 gcm_gf_mult(gcm->H, I, T); in gcm_mult_h()
|
A D | gcm_mult_h_arm_ce.c | 17 void gcm_mult_h(gcm_state *gcm, unsigned char *I) in gcm_mult_h() argument 26 b = get_be64(gcm->H); in gcm_mult_h() 27 a = get_be64(gcm->H + 8); in gcm_mult_h()
|
A D | gcm_test.c | 322 gcm_state gcm; in gcm_test() 335 if ((err = gcm_init(&gcm, idx, tests[0].K, tests[0].keylen)) != CRYPT_OK) return err; in gcm_test() 336 if ((err = gcm_add_iv(&gcm, tests[0].IV, tests[0].IVlen)) != CRYPT_OK) return err; in gcm_test() 338 if ((err = gcm_done(&gcm, T[0], &y)) != CRYPT_OK) return err; in gcm_test()
|
/optee_os-3.20.0/core/lib/libtomcrypt/ |
A D | gcm.c | 69 struct tee_gcm_state *gcm = to_tee_gcm_state(aectx); in crypto_aes_gcm_init() local 75 memset(&gcm->ctx, 0, sizeof(gcm->ctx)); in crypto_aes_gcm_init() 76 gcm->tag_len = tag_len; in crypto_aes_gcm_init() 83 ltc_res = gcm_add_iv(&gcm->ctx, nonce, nonce_len); in crypto_aes_gcm_init() 93 struct tee_gcm_state *gcm = to_tee_gcm_state(aectx); in crypto_aes_gcm_update_aad() local 97 ltc_res = gcm_add_aad(&gcm->ctx, data, len); in crypto_aes_gcm_update_aad() 127 if (gcm->ctx.mode == LTC_GCM_MODE_IV) { in crypto_aes_gcm_update_payload() 134 ltc_res = gcm_process(&gcm->ctx, pt, len, ct, dir); in crypto_aes_gcm_update_payload() 157 if (*dst_tag_len < gcm->tag_len) { in crypto_aes_gcm_enc_final() 158 *dst_tag_len = gcm->tag_len; in crypto_aes_gcm_enc_final() [all …]
|
A D | sub.mk | 124 srcs-$(_CFG_CORE_LTC_GCM) += gcm.c
|
/optee_os-3.20.0/core/crypto/ |
A D | sub.mk | 4 srcs-y += aes-gcm.c 6 srcs-y += aes-gcm-sw.c 8 srcs-y += aes-gcm-ghash-tbl.c
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ |
A D | sub.mk | 2 subdirs-$(_CFG_CORE_LTC_GCM) += gcm
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 505 void gcm_mult_h(const gcm_state *gcm, unsigned char *I); 507 int gcm_init(gcm_state *gcm, int cipher, 510 int gcm_reset(gcm_state *gcm); 512 int gcm_add_iv(gcm_state *gcm, 515 int gcm_add_aad(gcm_state *gcm, 518 int gcm_process(gcm_state *gcm, 523 int gcm_done(gcm_state *gcm,
|
/optee_os-3.20.0/core/arch/arm/crypto/ |
A D | sub.mk | 4 srcs-y += aes-gcm-ce.c
|
/optee_os-3.20.0/lib/libmbedtls/ |
A D | sub.mk | 35 SRCS_CRYPTO += gcm.c
|