Home
last modified time | relevance | path

Searched refs:ocb (Results 1 – 20 of 20) sorted by relevance

/external/dropbear/libtomcrypt/src/encauth/ocb/
Docb_init.c47 int ocb_init(ocb_state *ocb, int cipher, in ocb_init() argument
52 LTC_ARGCHK(ocb != NULL); in ocb_init()
62 ocb->block_len = cipher_descriptor[cipher].block_length; in ocb_init()
64 if (polys[poly].len == ocb->block_len) { in ocb_init()
68 if (polys[poly].len != ocb->block_len) { in ocb_init()
73 if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &ocb->key)) != CRYPT_OK) { in ocb_init()
78 zeromem(ocb->L, ocb->block_len); in ocb_init()
79 if ((err = cipher_descriptor[cipher].ecb_encrypt(ocb->L, ocb->L, &ocb->key)) != CRYPT_OK) { in ocb_init()
84 for (x = 0; x < ocb->block_len; x++) { in ocb_init()
85 ocb->R[x] = ocb->L[x] ^ nonce[x]; in ocb_init()
[all …]
Ds_ocb_done.c39 int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, in s_ocb_done() argument
46 LTC_ARGCHK(ocb != NULL); in s_ocb_done()
51 if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { in s_ocb_done()
54 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length || in s_ocb_done()
55 (int)ptlen > ocb->block_len || (int)ptlen < 0) { in s_ocb_done()
77 ocb_shift_xor(ocb, X); in s_ocb_done()
78 XMEMCPY(Z, X, ocb->block_len); in s_ocb_done()
80 X[ocb->block_len-1] ^= (ptlen*8)&255; in s_ocb_done()
81 X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; in s_ocb_done()
82 for (x = 0; x < ocb->block_len; x++) { in s_ocb_done()
[all …]
Docb_decrypt.c27 int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt) in ocb_decrypt() argument
32 LTC_ARGCHK(ocb != NULL); in ocb_decrypt()
37 if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { in ocb_decrypt()
40 LTC_ARGCHK(cipher_descriptor[ocb->cipher].ecb_decrypt != NULL); in ocb_decrypt()
43 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { in ocb_decrypt()
48 ocb_shift_xor(ocb, Z); in ocb_decrypt()
51 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
54 if ((err = cipher_descriptor[ocb->cipher].ecb_decrypt(tmp, pt, &ocb->key)) != CRYPT_OK) { in ocb_decrypt()
57 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
62 for (x = 0; x < ocb->block_len; x++) { in ocb_decrypt()
[all …]
Docb_encrypt_authenticate_memory.c41 ocb_state *ocb; in ocb_encrypt_authenticate_memory() local
51 ocb = XMALLOC(sizeof(ocb_state)); in ocb_encrypt_authenticate_memory()
52 if (ocb == NULL) { in ocb_encrypt_authenticate_memory()
56 if ((err = ocb_init(ocb, cipher, key, keylen, nonce)) != CRYPT_OK) { in ocb_encrypt_authenticate_memory()
60 while (ptlen > (unsigned long)ocb->block_len) { in ocb_encrypt_authenticate_memory()
61 if ((err = ocb_encrypt(ocb, pt, ct)) != CRYPT_OK) { in ocb_encrypt_authenticate_memory()
64 ptlen -= ocb->block_len; in ocb_encrypt_authenticate_memory()
65 pt += ocb->block_len; in ocb_encrypt_authenticate_memory()
66 ct += ocb->block_len; in ocb_encrypt_authenticate_memory()
69 err = ocb_done_encrypt(ocb, pt, ptlen, ct, tag, taglen); in ocb_encrypt_authenticate_memory()
[all …]
Docb_encrypt.c27 int ocb_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned char *ct) in ocb_encrypt() argument
32 LTC_ARGCHK(ocb != NULL); in ocb_encrypt()
35 if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { in ocb_encrypt()
38 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { in ocb_encrypt()
43 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
44 ocb->checksum[x] ^= pt[x]; in ocb_encrypt()
48 ocb_shift_xor(ocb, Z); in ocb_encrypt()
51 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
54 if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(tmp, ct, &ocb->key)) != CRYPT_OK) { in ocb_encrypt()
57 for (x = 0; x < ocb->block_len; x++) { in ocb_encrypt()
Docb_decrypt_verify_memory.c43 ocb_state *ocb; in ocb_decrypt_verify_memory() local
53 ocb = XMALLOC(sizeof(ocb_state)); in ocb_decrypt_verify_memory()
54 if (ocb == NULL) { in ocb_decrypt_verify_memory()
58 if ((err = ocb_init(ocb, cipher, key, keylen, nonce)) != CRYPT_OK) { in ocb_decrypt_verify_memory()
62 while (ctlen > (unsigned long)ocb->block_len) { in ocb_decrypt_verify_memory()
63 if ((err = ocb_decrypt(ocb, ct, pt)) != CRYPT_OK) { in ocb_decrypt_verify_memory()
66 ctlen -= ocb->block_len; in ocb_decrypt_verify_memory()
67 pt += ocb->block_len; in ocb_decrypt_verify_memory()
68 ct += ocb->block_len; in ocb_decrypt_verify_memory()
71 err = ocb_done_decrypt(ocb, ct, ctlen, pt, tag, taglen, stat); in ocb_decrypt_verify_memory()
[all …]
Docb_shift_xor.c25 void ocb_shift_xor(ocb_state *ocb, unsigned char *Z) in ocb_shift_xor() argument
28 y = ocb_ntz(ocb->block_index++); in ocb_shift_xor()
29 for (x = 0; x < ocb->block_len; x++) { in ocb_shift_xor()
30 ocb->Li[x] ^= ocb->Ls[y][x]; in ocb_shift_xor()
31 Z[x] = ocb->Li[x] ^ ocb->R[x]; in ocb_shift_xor()
Docb_done_encrypt.c30 int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, in ocb_done_encrypt() argument
33 LTC_ARGCHK(ocb != NULL); in ocb_done_encrypt()
38 return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0); in ocb_done_encrypt()
Docb_done_decrypt.c31 int ocb_done_decrypt(ocb_state *ocb, in ocb_done_decrypt() argument
40 LTC_ARGCHK(ocb != NULL); in ocb_done_decrypt()
56 if ((err = s_ocb_done(ocb, ct, ctlen, pt, tagbuf, &tagbuflen, 1)) != CRYPT_OK) { in ocb_done_decrypt()
/external/dropbear/libtomcrypt/
DAndroid.mk20 src/encauth/gcm/gcm_reset.c src/encauth/gcm/gcm_test.c src/encauth/ocb/ocb_decrypt.c \
21 src/encauth/ocb/ocb_decrypt_verify_memory.c src/encauth/ocb/ocb_done_decrypt.c \
22 src/encauth/ocb/ocb_done_encrypt.c src/encauth/ocb/ocb_encrypt.c \
23 src/encauth/ocb/ocb_encrypt_authenticate_memory.c src/encauth/ocb/ocb_init.c src/encauth/ocb/ocb_nt…
24 src/encauth/ocb/ocb_shift_xor.c src/encauth/ocb/ocb_test.c src/encauth/ocb/s_ocb_done.c \
DMakefile.in111 src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \
112 src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \
113 src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
114 src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_nt…
115 src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
Dmakefile.msvc18 src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj src/encauth/ocb/ocb_decrypt.obj \
19 src/encauth/ocb/ocb_decrypt_verify_memory.obj src/encauth/ocb/ocb_done_decrypt.obj \
20 src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \
21 src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/oc…
22 src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \
Dmakefile.icc108 src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \
109 src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \
110 src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
111 src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_nt…
112 src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
Dmakefile.unix54 src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \
55 src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \
56 src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
57 src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_nt…
58 src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
Dmakefile.shared113 src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \
114 src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \
115 src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
116 src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_nt…
117 src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
Dcrypt.tex1336 \index{ocb\_init()}
1338 int ocb_init( ocb_state *ocb,
1345 This will initialize the \textit{ocb} context using cipher descriptor \textit{cipher}. It will use…
1352 \index{ocb\_encrypt()} \index{ocb\_decrypt()}
1354 int ocb_encrypt( ocb_state *ocb,
1358 int ocb_decrypt( ocb_state *ocb,
1365 …unctions given a single \textit{ocb} state. For bi-directional communication you will have to ini…
1372 \index{ocb\_done\_encrypt()}
1374 int ocb_done_encrypt( ocb_state *ocb,
1382 This will terminate an encrypt stream \textit{ocb}. If you have trailing bytes of plaintext that w…
[all …]
Dchanges599 -- Updated eax so the eax_done() would clear the state [like hmac,pmac,ocb] when
615 v0.94 -- removed unused variables from ocb.c and fixed it to match known test vectors.
/external/dropbear/libtomcrypt/src/headers/
Dtomcrypt_mac.h155 int ocb_init(ocb_state *ocb, int cipher,
158 int ocb_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned char *ct);
159 int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt);
161 int ocb_done_encrypt(ocb_state *ocb,
166 int ocb_done_decrypt(ocb_state *ocb,
189 void ocb_shift_xor(ocb_state *ocb, unsigned char *Z);
191 int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen,
/external/dropbear/
Dconfigure.in628 AS_MKDIR_P(libtomcrypt/src/encauth/ocb)
Dconfigure10872 mkdir -p libtomcrypt/src/encauth/ocb
10874 as_dir=libtomcrypt/src/encauth/ocb