Mercurial > dropbear
comparison libtomcrypt/src/ciphers/anubis.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 | 0cbe8f6dbf9e |
children | 6dba84798cd5 |
comparison
equal
deleted
inserted
replaced
1434:27b9ddb06b09 | 1435:f849a5ca2efc |
---|---|
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 * | 8 * |
9 * Tom St Denis, [email protected], http://libtomcrypt.com | 9 * Tom St Denis, [email protected], http://libtom.org |
10 */ | 10 */ |
11 | 11 |
12 /** | 12 /** |
13 @file anubis.c | 13 @file anubis.c |
14 Anubis implementation derived from public domain source | 14 Anubis implementation derived from public domain source |
15 Authors: Paulo S.L.M. Barreto and Vincent Rijmen. | 15 Authors: Paulo S.L.M. Barreto and Vincent Rijmen. |
16 */ | 16 */ |
17 | 17 |
18 #include "tomcrypt.h" | 18 #include "tomcrypt.h" |
19 | 19 |
20 #ifdef ANUBIS | 20 #ifdef LTC_ANUBIS |
21 | 21 |
22 const struct ltc_cipher_descriptor anubis_desc = { | 22 const struct ltc_cipher_descriptor anubis_desc = { |
23 "anubis", | 23 "anubis", |
24 19, | 24 19, |
25 16, 40, 16, 12, | 25 16, 40, 16, 12, |
46 * Though Anubis is endianness-neutral, the encryption tables are listed | 46 * Though Anubis is endianness-neutral, the encryption tables are listed |
47 * in BIG-ENDIAN format, which is adopted throughout this implementation | 47 * in BIG-ENDIAN format, which is adopted throughout this implementation |
48 * (but little-endian notation would be equally suitable if consistently | 48 * (but little-endian notation would be equally suitable if consistently |
49 * employed). | 49 * employed). |
50 */ | 50 */ |
51 #if defined(ANUBIS_TWEAK) | 51 #if defined(LTC_ANUBIS_TWEAK) |
52 | 52 |
53 static const ulong32 T0[256] = { | 53 static const ulong32 T0[256] = { |
54 0xba69d2bbU, 0x54a84de5U, 0x2f5ebce2U, 0x74e8cd25U, | 54 0xba69d2bbU, 0x54a84de5U, 0x2f5ebce2U, 0x74e8cd25U, |
55 0x53a651f7U, 0xd3bb6bd0U, 0xd2b96fd6U, 0x4d9a29b3U, | 55 0x53a651f7U, 0xd3bb6bd0U, 0xd2b96fd6U, 0x4d9a29b3U, |
56 0x50a05dfdU, 0xac458acfU, 0x8d070e09U, 0xbf63c6a5U, | 56 0x50a05dfdU, 0xac458acfU, 0x8d070e09U, 0xbf63c6a5U, |
1172 #else | 1172 #else |
1173 static const struct test { | 1173 static const struct test { |
1174 int keylen; | 1174 int keylen; |
1175 unsigned char pt[16], ct[16], key[40]; | 1175 unsigned char pt[16], ct[16], key[40]; |
1176 } tests[] = { | 1176 } tests[] = { |
1177 #ifndef ANUBIS_TWEAK | 1177 #ifndef LTC_ANUBIS_TWEAK |
1178 /**** ORIGINAL ANUBIS ****/ | 1178 /**** ORIGINAL LTC_ANUBIS ****/ |
1179 /* 128 bit keys */ | 1179 /* 128 bit keys */ |
1180 { | 1180 { |
1181 16, | 1181 16, |
1182 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1182 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
1183 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | 1183 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, |
1331 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1331 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
1332 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1332 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
1333 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } | 1333 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } |
1334 } | 1334 } |
1335 #else | 1335 #else |
1336 /**** Tweaked ANUBIS ****/ | 1336 /**** Tweaked LTC_ANUBIS ****/ |
1337 /* 128 bit keys */ | 1337 /* 128 bit keys */ |
1338 { | 1338 { |
1339 16, | 1339 16, |
1340 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 1340 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
1341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, | 1341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, |
1551 } | 1551 } |
1552 | 1552 |
1553 #endif | 1553 #endif |
1554 | 1554 |
1555 | 1555 |
1556 /* $Source: /cvs/libtom/libtomcrypt/src/ciphers/anubis.c,v $ */ | 1556 /* $Source$ */ |
1557 /* $Revision: 1.15 $ */ | 1557 /* $Revision$ */ |
1558 /* $Date: 2006/11/15 12:41:28 $ */ | 1558 /* $Date$ */ |