Home
last modified time | relevance | path

Searched refs:ofb (Results 1 – 7 of 7) sorted by relevance

/optee_os/core/lib/libtomcrypt/src/modes/ofb/
A Dofb_encrypt.c27 int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_OFB *ofb) in ofb_encrypt() argument
32 LTC_ARGCHK(ofb != NULL); in ofb_encrypt()
33 if ((err = cipher_is_valid(ofb->cipher)) != CRYPT_OK) { in ofb_encrypt()
38 if (ofb->blocklen < 0 || ofb->blocklen > (int)sizeof(ofb->IV) || in ofb_encrypt()
39 ofb->padlen < 0 || ofb->padlen > (int)sizeof(ofb->IV)) { in ofb_encrypt()
44 if (ofb->padlen == ofb->blocklen) { in ofb_encrypt()
45 …if ((err = cipher_descriptor[ofb->cipher]->ecb_encrypt(ofb->IV, ofb->IV, &ofb->key)) != CRYPT_OK) { in ofb_encrypt()
48 ofb->padlen = 0; in ofb_encrypt()
50 *ct++ = *pt++ ^ ofb->IV[(ofb->padlen)++]; in ofb_encrypt()
A Dofb_start.c31 int keylen, int num_rounds, symmetric_OFB *ofb) in ofb_start() argument
37 LTC_ARGCHK(ofb != NULL); in ofb_start()
44 ofb->cipher = cipher; in ofb_start()
45 ofb->blocklen = cipher_descriptor[cipher]->block_length; in ofb_start()
46 for (x = 0; x < ofb->blocklen; x++) { in ofb_start()
47 ofb->IV[x] = IV[x]; in ofb_start()
51 ofb->padlen = ofb->blocklen; in ofb_start()
52 return cipher_descriptor[cipher]->setup(key, keylen, num_rounds, &ofb->key); in ofb_start()
A Dofb_setiv.c26 int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb) in ofb_setiv() argument
31 LTC_ARGCHK(ofb != NULL); in ofb_setiv()
33 if ((err = cipher_is_valid(ofb->cipher)) != CRYPT_OK) { in ofb_setiv()
37 if (len != (unsigned long)ofb->blocklen) { in ofb_setiv()
42 ofb->padlen = 0; in ofb_setiv()
43 return cipher_descriptor[ofb->cipher]->ecb_encrypt(IV, ofb->IV, &ofb->key); in ofb_setiv()
A Dofb_getiv.c26 int ofb_getiv(unsigned char *IV, unsigned long *len, const symmetric_OFB *ofb) in ofb_getiv() argument
30 LTC_ARGCHK(ofb != NULL); in ofb_getiv()
31 if ((unsigned long)ofb->blocklen > *len) { in ofb_getiv()
32 *len = ofb->blocklen; in ofb_getiv()
35 XMEMCPY(IV, ofb->IV, ofb->blocklen); in ofb_getiv()
36 *len = ofb->blocklen; in ofb_getiv()
A Dofb_done.c23 int ofb_done(symmetric_OFB *ofb) in ofb_done() argument
26 LTC_ARGCHK(ofb != NULL); in ofb_done()
28 if ((err = cipher_is_valid(ofb->cipher)) != CRYPT_OK) { in ofb_done()
31 cipher_descriptor[ofb->cipher]->done(&ofb->key); in ofb_done()
A Dofb_decrypt.c27 int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_OFB *ofb) in ofb_decrypt() argument
31 LTC_ARGCHK(ofb != NULL); in ofb_decrypt()
32 return ofb_encrypt(ct, pt, len, ofb); in ofb_decrypt()
/optee_os/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_cipher.h883 int keylen, int num_rounds, symmetric_OFB *ofb);
884 int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_OFB *ofb);
885 int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_OFB *ofb);
886 int ofb_getiv(unsigned char *IV, unsigned long *len, const symmetric_OFB *ofb);
887 int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb);
888 int ofb_done(symmetric_OFB *ofb);

Completed in 10 milliseconds