Mercurial > dropbear
comparison libtomcrypt/src/mac/pmac/pmac_shift_xor.c @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 6dba84798cd5 |
children |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
3 * LibTomCrypt is a library that provides various cryptographic | 3 * LibTomCrypt is a library that provides various cryptographic |
4 * algorithms in a highly modular and flexible manner. | 4 * algorithms in a highly modular and flexible manner. |
5 * | 5 * |
6 * The library is free for all purposes without any express | 6 * The library is free for all purposes without any express |
7 * guarantee it works. | 7 * guarantee it works. |
8 * | |
9 * Tom St Denis, [email protected], http://libtom.org | |
10 */ | 8 */ |
11 #include "tomcrypt.h" | 9 #include "tomcrypt.h" |
12 | 10 |
13 /** | 11 /** |
14 @file pmac_shift_xor.c | 12 @file pmac_shift_xor.c |
15 PMAC implementation, internal function, by Tom St Denis | 13 PMAC implementation, internal function, by Tom St Denis |
16 */ | 14 */ |
17 | 15 |
18 #ifdef LTC_PMAC | 16 #ifdef LTC_PMAC |
19 | 17 |
20 /** | 18 /** |
25 { | 23 { |
26 int x, y; | 24 int x, y; |
27 y = pmac_ntz(pmac->block_index++); | 25 y = pmac_ntz(pmac->block_index++); |
28 #ifdef LTC_FAST | 26 #ifdef LTC_FAST |
29 for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) { | 27 for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) { |
30 *((LTC_FAST_TYPE*)((unsigned char *)pmac->Li + x)) ^= | 28 *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Li + x)) ^= |
31 *((LTC_FAST_TYPE*)((unsigned char *)pmac->Ls[y] + x)); | 29 *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Ls[y] + x)); |
32 } | 30 } |
33 #else | 31 #else |
34 for (x = 0; x < pmac->block_len; x++) { | 32 for (x = 0; x < pmac->block_len; x++) { |
35 pmac->Li[x] ^= pmac->Ls[y][x]; | 33 pmac->Li[x] ^= pmac->Ls[y][x]; |
36 } | 34 } |
37 #endif | 35 #endif |
38 } | 36 } |
39 | 37 |
40 #endif | 38 #endif |
41 | 39 |
42 /* $Source$ */ | 40 /* ref: $Format:%D$ */ |
43 /* $Revision$ */ | 41 /* git commit: $Format:%H$ */ |
44 /* $Date$ */ | 42 /* commit time: $Format:%ai$ */ |