Home
last modified time | relevance | path

Searched refs:IV (Results 1 – 25 of 48) sorted by relevance

12

/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/f8/
A Df8_encrypt.c32 if (f8->blocklen < 0 || f8->blocklen > (int)sizeof(f8->IV) || in f8_encrypt()
33 f8->padlen < 0 || f8->padlen > (int)sizeof(f8->IV)) { in f8_encrypt()
45 f8->IV[x] ^= f8->MIV[x] ^ buf[x]; in f8_encrypt()
47 … if ((err = cipher_descriptor[f8->cipher]->ecb_encrypt(f8->IV, f8->IV, &f8->key)) != CRYPT_OK) { in f8_encrypt()
59 …TYPE_PTR_CAST(&ct[x])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&f8->IV[x])); in f8_encrypt()
60 …*(LTC_FAST_TYPE_PTR_CAST(&f8->IV[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&f8->MIV[x])) ^ *(LTC_FAST_TYPE_… in f8_encrypt()
62 … if ((err = cipher_descriptor[f8->cipher]->ecb_encrypt(f8->IV, f8->IV, &f8->key)) != CRYPT_OK) { in f8_encrypt()
78 f8->IV[x] ^= f8->MIV[x] ^ buf[x]; in f8_encrypt()
80 … if ((err = cipher_descriptor[f8->cipher]->ecb_encrypt(f8->IV, f8->IV, &f8->key)) != CRYPT_OK) { in f8_encrypt()
85 *ct++ = *pt++ ^ f8->IV[f8->padlen++]; in f8_encrypt()
A Df8_getiv.c19 int f8_getiv(unsigned char *IV, unsigned long *len, const symmetric_F8 *f8) in f8_getiv() argument
21 LTC_ARGCHK(IV != NULL); in f8_getiv()
28 XMEMCPY(IV, f8->IV, f8->blocklen); in f8_getiv()
A Df8_setiv.c19 int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8) in f8_setiv() argument
23 LTC_ARGCHK(IV != NULL); in f8_setiv()
36 return cipher_descriptor[f8->cipher]->ecb_encrypt(IV, f8->IV, &f8->key); in f8_setiv()
A Df8_start.c25 int f8_start( int cipher, const unsigned char *IV, in f8_start() argument
33 LTC_ARGCHK(IV != NULL); in f8_start()
72 if ((err = cipher_descriptor[f8->cipher]->ecb_encrypt(IV, f8->MIV, &f8->key)) != CRYPT_OK) { in f8_start()
77 zeromem(f8->IV, sizeof(f8->IV)); in f8_start()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/lrw/
A Dlrw_setiv.c19 int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw) in lrw_setiv() argument
26 LTC_ARGCHK(IV != NULL); in lrw_setiv()
38 XMEMCPY(lrw->IV, IV, 16); in lrw_setiv()
47 XMEMCPY(T, &lrw->PC[0][IV[0]][0], 16); in lrw_setiv()
51 *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][IV[x]][y])); in lrw_setiv()
55 T[y] ^= lrw->PC[x][IV[x]][y]; in lrw_setiv()
61 gcm_gf_mult(lrw->tweak, IV, lrw->pad); in lrw_setiv()
A Dlrw_getiv.c19 int lrw_getiv(unsigned char *IV, unsigned long *len, const symmetric_LRW *lrw) in lrw_getiv() argument
21 LTC_ARGCHK(IV != NULL); in lrw_getiv()
29 XMEMCPY(IV, lrw->IV, 16); in lrw_getiv()
A Dlrw_process.c43 lrw->IV[x] = (lrw->IV[x] + 1) & 255; in lrw_process()
44 if (lrw->IV[x]) { in lrw_process()
55 …) ^= *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][lrw->IV[x]][y])) ^ *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][… in lrw_process()
59 lrw->pad[y] ^= lrw->PC[x][lrw->IV[x]][y] ^ lrw->PC[x][(lrw->IV[x]-1)&255][y]; in lrw_process()
64 gcm_gf_mult(lrw->tweak, lrw->IV, lrw->pad); in lrw_process()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/f9/
A Df9_process.c39 *(LTC_FAST_TYPE_PTR_CAST(&(f9->IV[x]))) ^= *(LTC_FAST_TYPE_PTR_CAST(&(in[x]))); in f9_process()
41 cipher_descriptor[f9->cipher]->ecb_encrypt(f9->IV, f9->IV, &f9->key); in f9_process()
43 *(LTC_FAST_TYPE_PTR_CAST(&(f9->ACC[x]))) ^= *(LTC_FAST_TYPE_PTR_CAST(&(f9->IV[x]))); in f9_process()
53 cipher_descriptor[f9->cipher]->ecb_encrypt(f9->IV, f9->IV, &f9->key); in f9_process()
55 f9->ACC[x] ^= f9->IV[x]; in f9_process()
59 f9->IV[f9->buflen++] ^= *in++; in f9_process()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/cfb/
A Dcfb_start.c23 int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, in cfb_start() argument
28 LTC_ARGCHK(IV != NULL); in cfb_start()
41 cfb->IV[x] = IV[x]; in cfb_start()
51 return cipher_descriptor[cfb->cipher]->ecb_encrypt(cfb->IV, cfb->IV, &cfb->key); in cfb_start()
A Dcfb_getiv.c19 int cfb_getiv(unsigned char *IV, unsigned long *len, const symmetric_CFB *cfb) in cfb_getiv() argument
21 LTC_ARGCHK(IV != NULL); in cfb_getiv()
28 XMEMCPY(IV, cfb->IV, cfb->blocklen); in cfb_getiv()
A Dcfb_setiv.c19 int cfb_setiv(const unsigned char *IV, unsigned long len, symmetric_CFB *cfb) in cfb_setiv() argument
23 LTC_ARGCHK(IV != NULL); in cfb_setiv()
36 return cipher_descriptor[cfb->cipher]->ecb_encrypt(IV, cfb->IV, &cfb->key); in cfb_setiv()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/cbc/
A Dcbc_setiv.c20 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc) in cbc_setiv() argument
22 LTC_ARGCHK(IV != NULL); in cbc_setiv()
27 XMEMCPY(cbc->IV, IV, len); in cbc_setiv()
A Dcbc_getiv.c19 int cbc_getiv(unsigned char *IV, unsigned long *len, const symmetric_CBC *cbc) in cbc_getiv() argument
21 LTC_ARGCHK(IV != NULL); in cbc_getiv()
28 XMEMCPY(IV, cbc->IV, cbc->blocklen); in cbc_getiv()
A Dcbc_encrypt.c34 if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { in cbc_encrypt()
48 …return cipher_descriptor[cbc->cipher]->accel_cbc_encrypt(pt, ct, len / cbc->blocklen, cbc->IV, &cb… in cbc_encrypt()
54 …*(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) ^= *(LTC_FAST_TYPE_PTR_CAST((unsigned char… in cbc_encrypt()
58 cbc->IV[x] ^= pt[x]; in cbc_encrypt()
63 if ((err = cipher_descriptor[cbc->cipher]->ecb_encrypt(cbc->IV, ct, &cbc->key)) != CRYPT_OK) { in cbc_encrypt()
70 …*(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) = *(LTC_FAST_TYPE_PTR_CAST((unsigned char … in cbc_encrypt()
74 cbc->IV[x] = ct[x]; in cbc_encrypt()
A Dcbc_start.c22 int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, in cbc_start() argument
27 LTC_ARGCHK(IV != NULL); in cbc_start()
45 cbc->IV[x] = IV[x]; in cbc_start()
A Dcbc_decrypt.c40 …if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV) || cbc->blocklen > (int)sizeof(tmp))… in cbc_decrypt()
54 …return cipher_descriptor[cbc->cipher]->accel_cbc_decrypt(ct, pt, len / cbc->blocklen, cbc->IV, &cb… in cbc_decrypt()
65 …tmpy = *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) ^ *(LTC_FAST_TYPE_PTR_CAST((unsigne… in cbc_decrypt()
66 …*(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) = *(LTC_FAST_TYPE_PTR_CAST((unsigned char … in cbc_decrypt()
71 tmpy = tmp[x] ^ cbc->IV[x]; in cbc_decrypt()
72 cbc->IV[x] = ct[x]; in cbc_decrypt()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_process.c42 *(LTC_FAST_TYPE_PTR_CAST(&(xcbc->IV[x]))) ^= *(LTC_FAST_TYPE_PTR_CAST(&(in[x]))); in xcbc_process()
44 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process()
53 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process()
56 xcbc->IV[xcbc->buflen++] ^= *in++; in xcbc_process()
A Dxcbc_done.c38 xcbc->IV[x] ^= xcbc->K[1][x]; in xcbc_done()
41 xcbc->IV[xcbc->buflen] ^= 0x80; in xcbc_done()
44 xcbc->IV[x] ^= xcbc->K[2][x]; in xcbc_done()
49 cipher_descriptor[xcbc->cipher]->ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_done()
54 out[x] = xcbc->IV[x]; in xcbc_done()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/ofb/
A Dofb_encrypt.c31 if (ofb->blocklen < 0 || ofb->blocklen > (int)sizeof(ofb->IV) || in ofb_encrypt()
32 ofb->padlen < 0 || ofb->padlen > (int)sizeof(ofb->IV)) { in ofb_encrypt()
38 …if ((err = cipher_descriptor[ofb->cipher]->ecb_encrypt(ofb->IV, ofb->IV, &ofb->key)) != CRYPT_OK) { in ofb_encrypt()
43 *ct++ = *pt++ ^ ofb->IV[(ofb->padlen)++]; in ofb_encrypt()
A Dofb_getiv.c19 int ofb_getiv(unsigned char *IV, unsigned long *len, const symmetric_OFB *ofb) in ofb_getiv() argument
21 LTC_ARGCHK(IV != NULL); in ofb_getiv()
28 XMEMCPY(IV, ofb->IV, ofb->blocklen); in ofb_getiv()
A Dofb_setiv.c19 int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb) in ofb_setiv() argument
23 LTC_ARGCHK(IV != NULL); in ofb_setiv()
36 return cipher_descriptor[ofb->cipher]->ecb_encrypt(IV, ofb->IV, &ofb->key); in ofb_setiv()
A Dofb_start.c23 int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, in ofb_start() argument
28 LTC_ARGCHK(IV != NULL); in ofb_start()
40 ofb->IV[x] = IV[x]; in ofb_start()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/ctr/
A Dctr_setiv.c19 int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr) in ctr_setiv() argument
23 LTC_ARGCHK(IV != NULL); in ctr_setiv()
36 XMEMCPY(ctr->ctr, IV, len); in ctr_setiv()
40 return cipher_descriptor[ctr->cipher]->ecb_encrypt(IV, ctr->pad, &ctr->key); in ctr_setiv()
A Dctr_getiv.c19 int ctr_getiv(unsigned char *IV, unsigned long *len, const symmetric_CTR *ctr) in ctr_getiv() argument
21 LTC_ARGCHK(IV != NULL); in ctr_getiv()
28 XMEMCPY(IV, ctr->ctr, ctr->blocklen); in ctr_getiv()
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_add_iv.c20 const unsigned char *IV, unsigned long IVlen) in gcm_add_iv() argument
27 LTC_ARGCHK(IV != NULL); in gcm_add_iv()
54 *(LTC_FAST_TYPE_PTR_CAST(&gcm->X[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&IV[x + y])); in gcm_add_iv()
59 IV += x; in gcm_add_iv()
65 gcm->buf[gcm->buflen++] = *IV++; in gcm_add_iv()

Completed in 14 milliseconds

12