comparison libtomcrypt/src/modes/xts/xts_mult_x.c @ 1435:f849a5ca2efc

update to libtomcrypt 1.17 (with Dropbear changes)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 17:50:50 +0800
parents
children 6dba84798cd5
comparison
equal deleted inserted replaced
1434:27b9ddb06b09 1435:f849a5ca2efc
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 * Tom St Denis, [email protected], http://libtom.org
10 */
11 #include "tomcrypt.h"
12
13 /**
14 Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects
15 */
16
17 #ifdef LTC_XTS_MODE
18
19 /** multiply by x
20 @param I The value to multiply by x (LFSR shift)
21 */
22 void xts_mult_x(unsigned char *I)
23 {
24 int x;
25 unsigned char t, tt;
26
27 for (x = t = 0; x < 16; x++) {
28 tt = I[x] >> 7;
29 I[x] = ((I[x] << 1) | t) & 0xFF;
30 t = tt;
31 }
32 if (tt) {
33 I[0] ^= 0x87;
34 }
35 }
36
37 #endif
38
39 /* $Source$ */
40 /* $Revision$ */
41 /* $Date$ */
42