]> pd.if.org Git - zpackage/blob - libtomcrypt/src/encauth/ocb/ocb_shift_xor.c
remove ltc ciphers
[zpackage] / libtomcrypt / src / encauth / ocb / ocb_shift_xor.c
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2  *
3  * LibTomCrypt is a library that provides various cryptographic
4  * algorithms in a highly modular and flexible manner.
5  *
6  * The library is free for all purposes without any express
7  * guarantee it works.
8  */
9
10 /**
11    @file ocb_shift_xor.c
12    OCB implementation, internal function, by Tom St Denis
13 */
14 #include "tomcrypt.h"
15
16 #ifdef LTC_OCB_MODE
17
18 /**
19    Compute the shift/xor for OCB (internal function)
20    @param ocb  The OCB state
21    @param Z    The destination of the shift
22 */
23 void ocb_shift_xor(ocb_state *ocb, unsigned char *Z)
24 {
25    int x, y;
26    y = ocb_ntz(ocb->block_index++);
27    for (x = 0; x < ocb->block_len; x++) {
28        ocb->Li[x] ^= ocb->Ls[y][x];
29        Z[x]        = ocb->Li[x] ^ ocb->R[x];
30    }
31 }
32
33 #endif
34
35 /* ref:         $Format:%D$ */
36 /* git commit:  $Format:%H$ */
37 /* commit time: $Format:%ai$ */