comparison libtomcrypt/src/ciphers/xtea.c @ 1437:871b18fd7065 fuzz

merge from main (libtommath/libtomcrypt/curve25510-donna updates)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 22:51:45 +0800
parents f849a5ca2efc
children 6dba84798cd5
comparison
equal deleted inserted replaced
1432:41dca1e5ea34 1437:871b18fd7065
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 xtea.c 13 @file xtea.c
14 Implementation of XTEA, Tom St Denis 14 Implementation of LTC_XTEA, Tom St Denis
15 */ 15 */
16 #include "tomcrypt.h" 16 #include "tomcrypt.h"
17 17
18 #ifdef XTEA 18 #ifdef LTC_XTEA
19 19
20 const struct ltc_cipher_descriptor xtea_desc = 20 const struct ltc_cipher_descriptor xtea_desc =
21 { 21 {
22 "xtea", 22 "xtea",
23 1, 23 1,
65 65
66 return CRYPT_OK; 66 return CRYPT_OK;
67 } 67 }
68 68
69 /** 69 /**
70 Encrypts a block of text with XTEA 70 Encrypts a block of text with LTC_XTEA
71 @param pt The input plaintext (8 bytes) 71 @param pt The input plaintext (8 bytes)
72 @param ct The output ciphertext (8 bytes) 72 @param ct The output ciphertext (8 bytes)
73 @param skey The key as scheduled 73 @param skey The key as scheduled
74 @return CRYPT_OK if successful 74 @return CRYPT_OK if successful
75 */ 75 */
101 STORE32L(z, &ct[4]); 101 STORE32L(z, &ct[4]);
102 return CRYPT_OK; 102 return CRYPT_OK;
103 } 103 }
104 104
105 /** 105 /**
106 Decrypts a block of text with XTEA 106 Decrypts a block of text with LTC_XTEA
107 @param ct The input ciphertext (8 bytes) 107 @param ct The input ciphertext (8 bytes)
108 @param pt The output plaintext (8 bytes) 108 @param pt The output plaintext (8 bytes)
109 @param skey The key as scheduled 109 @param skey The key as scheduled
110 @return CRYPT_OK if successful 110 @return CRYPT_OK if successful
111 */ 111 */
137 STORE32L(z, &pt[4]); 137 STORE32L(z, &pt[4]);
138 return CRYPT_OK; 138 return CRYPT_OK;
139 } 139 }
140 140
141 /** 141 /**
142 Performs a self-test of the XTEA block cipher 142 Performs a self-test of the LTC_XTEA block cipher
143 @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled 143 @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
144 */ 144 */
145 int xtea_test(void) 145 int xtea_test(void)
146 { 146 {
147 #ifndef LTC_TEST 147 #ifndef LTC_TEST
204 #endif 204 #endif
205 205
206 206
207 207
208 208
209 /* $Source: /cvs/libtom/libtomcrypt/src/ciphers/xtea.c,v $ */ 209 /* $Source$ */
210 /* $Revision: 1.12 $ */ 210 /* $Revision$ */
211 /* $Date: 2006/11/08 23:01:06 $ */ 211 /* $Date$ */