Home
last modified time | relevance | path

Searched refs:xcbc (Results 1 – 14 of 14) sorted by relevance

/external/dropbear/libtomcrypt/src/mac/xcbc/
Dxcbc_done.c26 int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen) in xcbc_done() argument
29 LTC_ARGCHK(xcbc != NULL); in xcbc_done()
33 if ((err = cipher_is_valid(xcbc->cipher)) != CRYPT_OK) { in xcbc_done()
37 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher].block_length) || (xcbc->blocksize < 0) || in xcbc_done()
38 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_done()
43 if (xcbc->buflen == xcbc->blocksize) { in xcbc_done()
45 for (x = 0; x < xcbc->blocksize; x++) { in xcbc_done()
46 xcbc->IV[x] ^= xcbc->K[1][x]; in xcbc_done()
49 xcbc->IV[xcbc->buflen] ^= 0x80; in xcbc_done()
51 for (x = 0; x < xcbc->blocksize; x++) { in xcbc_done()
[all …]
Dxcbc_process.c26 int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen) in xcbc_process() argument
33 LTC_ARGCHK(xcbc != NULL); in xcbc_process()
37 if ((err = cipher_is_valid(xcbc->cipher)) != CRYPT_OK) { in xcbc_process()
41 if ((xcbc->blocksize > cipher_descriptor[xcbc->cipher].block_length) || (xcbc->blocksize < 0) || in xcbc_process()
42 (xcbc->buflen > xcbc->blocksize) || (xcbc->buflen < 0)) { in xcbc_process()
47 if (xcbc->buflen == 0) { in xcbc_process()
48 while (inlen > (unsigned long)xcbc->blocksize) { in xcbc_process()
49 for (x = 0; x < xcbc->blocksize; x += sizeof(LTC_FAST_TYPE)) { in xcbc_process()
50 *((LTC_FAST_TYPE*)&(xcbc->IV[x])) ^= *((LTC_FAST_TYPE*)&(in[x])); in xcbc_process()
52 cipher_descriptor[xcbc->cipher].ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in xcbc_process()
[all …]
Dxcbc_init.c27 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen) in xcbc_init() argument
32 LTC_ARGCHK(xcbc != NULL); in xcbc_init()
59 xcbc->K[y][x] = y + 1; in xcbc_init()
61 cipher_descriptor[cipher].ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init()
65 …err = cipher_descriptor[cipher].setup(xcbc->K[0], cipher_descriptor[cipher].block_length, 0, &xcbc in xcbc_init()
68 zeromem(xcbc->IV, cipher_descriptor[cipher].block_length); in xcbc_init()
69 xcbc->blocksize = cipher_descriptor[cipher].block_length; in xcbc_init()
70 xcbc->cipher = cipher; in xcbc_init()
71 xcbc->buflen = 0; in xcbc_init()
Dxcbc_memory.c35 xcbc_state *xcbc; in xcbc_memory() local
48 xcbc = XCALLOC(1, sizeof(*xcbc)); in xcbc_memory()
49 if (xcbc == NULL) { in xcbc_memory()
53 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory()
57 if ((err = xcbc_process(xcbc, in, inlen)) != CRYPT_OK) { in xcbc_memory()
61 err = xcbc_done(xcbc, out, outlen); in xcbc_memory()
63 XFREE(xcbc); in xcbc_memory()
Dxcbc_memory_multi.c39 xcbc_state *xcbc; in xcbc_memory_multi() local
50 xcbc = XMALLOC(sizeof(xcbc_state)); in xcbc_memory_multi()
51 if (xcbc == NULL) { in xcbc_memory_multi()
56 if ((err = xcbc_init(xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_memory_multi()
64 if ((err = xcbc_process(xcbc, curptr, curlen)) != CRYPT_OK) { in xcbc_memory_multi()
74 if ((err = xcbc_done(xcbc, out, outlen)) != CRYPT_OK) { in xcbc_memory_multi()
79 zeromem(xcbc, sizeof(xcbc_state)); in xcbc_memory_multi()
81 XFREE(xcbc); in xcbc_memory_multi()
Dxcbc_file.c39 xcbc_state xcbc; in xcbc_file()
53 if ((err = xcbc_init(&xcbc, cipher, key, keylen)) != CRYPT_OK) { in xcbc_file()
60 if ((err = xcbc_process(&xcbc, buf, x)) != CRYPT_OK) { in xcbc_file()
67 if ((err = xcbc_done(&xcbc, out, outlen)) != CRYPT_OK) { in xcbc_file()
/external/dropbear/libtomcrypt/
DAndroid.mk38 src/mac/pmac/pmac_shift_xor.c src/mac/pmac/pmac_test.c src/mac/xcbc/xcbc_done.c \
39 src/mac/xcbc/xcbc_file.c src/mac/xcbc/xcbc_init.c src/mac/xcbc/xcbc_memory.c \
40 src/mac/xcbc/xcbc_memory_multi.c src/mac/xcbc/xcbc_process.c src/mac/xcbc/xcbc_test.c \
DMakefile.in129 src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
130 src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
131 src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
Dmakefile.msvc36 src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \
37 src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \
38 src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \
Dmakefile.icc126 src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
127 src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
128 src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
Dmakefile.unix72 src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
73 src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
74 src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
Dmakefile.shared131 src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \
132 src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
133 src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
Dcrypt.tex2503 \index{xcbc\_init()}
2505 int xcbc_init( xcbc_state *xcbc,
2511 This will initialize the XCBC--MAC state \textit{xcbc}, with the key specified in \textit{key} of l…
2516 \index{xcbc\_process()}
2528 \index{xcbc\_done()}
2540 \index{xcbc\_memory()}
2549 …pher\_descriptor table. It will store the MAC in \textit{out} with the same rules as xcbc\_done().
2551 To xcbc a file use
2552 \index{xcbc\_file()}
2562 …pher\_descriptor table. It will store the MAC in \textit{out} with the same rules as xcbc\_done().
[all …]
/external/dropbear/libtomcrypt/src/headers/
Dtomcrypt_mac.h325 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen);
326 int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen);
327 int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen);