Skip to content

Commit 6595403

Browse files
authored
Merge pull request #506 from libtom/add-tea
Add TEA blockcipher
2 parents 8e044b8 + 79f812c commit 6595403

17 files changed

+398
-18
lines changed

doc/crypt.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ \subsection{Simple Encryption Demonstration}
600600
\index{Cipher descriptor table}
601601
\index{blowfish\_desc} \index{xtea\_desc} \index{rc2\_desc} \index{rc5\_desc} \index{rc6\_desc} \index{saferp\_desc} \index{aes\_desc} \index{twofish\_desc}
602602
\index{des\_desc} \index{des3\_desc} \index{noekeon\_desc} \index{skipjack\_desc} \index{anubis\_desc} \index{khazad\_desc} \index{kseed\_desc} \index{kasumi\_desc} \index{camellia\_desc} \index{aes\_enc\_desc}
603-
\index{idea\_desc} \index{serpent\_desc}
603+
\index{idea\_desc} \index{serpent\_desc} \index{tea\_desc}
604604
\begin{figure}[hpbt]
605605
\begin{small}
606606
\begin{center}
@@ -627,6 +627,7 @@ \subsection{Simple Encryption Demonstration}
627627
\hline Camellia & camellia\_desc & 16 & 16, 24, 32 & 18, 24 \\
628628
\hline IDEA & idea\_desc & 8 & 16 & 8 \\
629629
\hline Serpent & serpent\_desc & 16 & 16, 24, 32 & 32 \\
630+
\hline TEA & tea\_desc & 8 & 16 & 32 \\
630631
\hline
631632
\end{tabular}
632633
\end{center}

libtomcrypt_VS2008.vcproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@
395395
RelativePath="src\ciphers\skipjack.c"
396396
>
397397
</File>
398+
<File
399+
RelativePath="src\ciphers\tea.c"
400+
>
401+
</File>
398402
<File
399403
RelativePath="src\ciphers\xtea.c"
400404
>

makefile.mingw

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src
3939
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/idea.o src/ciphers/kasumi.o \
4040
src/ciphers/khazad.o src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o \
4141
src/ciphers/rc5.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o \
42-
src/ciphers/serpent.o src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o \
43-
src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o \
44-
src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o \
45-
src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o \
42+
src/ciphers/serpent.o src/ciphers/skipjack.o src/ciphers/tea.o src/ciphers/twofish/twofish.o \
43+
src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_add_nonce.o \
44+
src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_memory.o \
45+
src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o \
4646
src/encauth/chachapoly/chacha20poly1305_add_aad.o src/encauth/chachapoly/chacha20poly1305_decrypt.o \
4747
src/encauth/chachapoly/chacha20poly1305_done.o src/encauth/chachapoly/chacha20poly1305_encrypt.o \
4848
src/encauth/chachapoly/chacha20poly1305_init.o src/encauth/chachapoly/chacha20poly1305_memory.o \

makefile.msvc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.o
3232
src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/idea.obj src/ciphers/kasumi.obj \
3333
src/ciphers/khazad.obj src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj \
3434
src/ciphers/rc5.obj src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj \
35-
src/ciphers/serpent.obj src/ciphers/skipjack.obj src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj \
36-
src/encauth/ccm/ccm_add_aad.obj src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj \
37-
src/encauth/ccm/ccm_init.obj src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_process.obj \
38-
src/encauth/ccm/ccm_reset.obj src/encauth/ccm/ccm_test.obj \
35+
src/ciphers/serpent.obj src/ciphers/skipjack.obj src/ciphers/tea.obj src/ciphers/twofish/twofish.obj \
36+
src/ciphers/xtea.obj src/encauth/ccm/ccm_add_aad.obj src/encauth/ccm/ccm_add_nonce.obj \
37+
src/encauth/ccm/ccm_done.obj src/encauth/ccm/ccm_init.obj src/encauth/ccm/ccm_memory.obj \
38+
src/encauth/ccm/ccm_process.obj src/encauth/ccm/ccm_reset.obj src/encauth/ccm/ccm_test.obj \
3939
src/encauth/chachapoly/chacha20poly1305_add_aad.obj src/encauth/chachapoly/chacha20poly1305_decrypt.obj \
4040
src/encauth/chachapoly/chacha20poly1305_done.obj src/encauth/chachapoly/chacha20poly1305_encrypt.obj \
4141
src/encauth/chachapoly/chacha20poly1305_init.obj src/encauth/chachapoly/chacha20poly1305_memory.obj \

makefile.unix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src
4949
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/idea.o src/ciphers/kasumi.o \
5050
src/ciphers/khazad.o src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o \
5151
src/ciphers/rc5.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o \
52-
src/ciphers/serpent.o src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o \
53-
src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o \
54-
src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o \
55-
src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o \
52+
src/ciphers/serpent.o src/ciphers/skipjack.o src/ciphers/tea.o src/ciphers/twofish/twofish.o \
53+
src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_add_nonce.o \
54+
src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_memory.o \
55+
src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o \
5656
src/encauth/chachapoly/chacha20poly1305_add_aad.o src/encauth/chachapoly/chacha20poly1305_decrypt.o \
5757
src/encauth/chachapoly/chacha20poly1305_done.o src/encauth/chachapoly/chacha20poly1305_encrypt.o \
5858
src/encauth/chachapoly/chacha20poly1305_init.o src/encauth/chachapoly/chacha20poly1305_memory.o \

makefile_include.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src
210210
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/idea.o src/ciphers/kasumi.o \
211211
src/ciphers/khazad.o src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o \
212212
src/ciphers/rc5.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o \
213-
src/ciphers/serpent.o src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o \
214-
src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o \
215-
src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o \
216-
src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o \
213+
src/ciphers/serpent.o src/ciphers/skipjack.o src/ciphers/tea.o src/ciphers/twofish/twofish.o \
214+
src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_add_nonce.o \
215+
src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_memory.o \
216+
src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o \
217217
src/encauth/chachapoly/chacha20poly1305_add_aad.o src/encauth/chachapoly/chacha20poly1305_decrypt.o \
218218
src/encauth/chachapoly/chacha20poly1305_done.o src/encauth/chachapoly/chacha20poly1305_encrypt.o \
219219
src/encauth/chachapoly/chacha20poly1305_init.o src/encauth/chachapoly/chacha20poly1305_memory.o \

notes/cipher_tv.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,3 +2549,57 @@ Key Size: 32 bytes
25492549
49: 80DEC7F355AEA1BCCD1F8209C3FE9E16
25502550

25512551

2552+
Cipher: tea
2553+
Key Size: 16 bytes
2554+
0: 07D3CA2209D99A34
2555+
1: 8AA2AB0843657382
2556+
2: 231B235F7895BDA1
2557+
3: 51CFB710B6CA50FD
2558+
4: BC14673856317504
2559+
5: 5BBE5F3F0897B3EF
2560+
6: ABAAD961EAEE4908
2561+
7: CFFD532347EB7D6B
2562+
8: 0A677D4419B1F8CE
2563+
9: E7D3055744921384
2564+
10: 1458509E9D9AAE6D
2565+
11: 038D0CB56FFD996B
2566+
12: 2B36B73D385D3DF0
2567+
13: 3DBC5982A528B9AA
2568+
14: D6C7E606AF90CA7F
2569+
15: 9CE6BBCC39AF11C3
2570+
16: 591F6776C4B59FF3
2571+
17: D39322630621C580
2572+
18: DE2D2D98D1526D89
2573+
19: B101FC38A8F915D6
2574+
20: A2695E46228277FB
2575+
21: CF8B6A0B1B1CEE21
2576+
22: 29990F0FFBC40861
2577+
23: 0F765791933BC0F9
2578+
24: F94736075FDF68D5
2579+
25: 2B29EBBEFA233845
2580+
26: 6801BACE0B6AD59D
2581+
27: 28DEC844CB3BC864
2582+
28: 066B6AF32EC592E0
2583+
29: E9FB041FEC4B2A9B
2584+
30: D84C73A0A8373FAD
2585+
31: 2C9E423F3762E688
2586+
32: F6BAFB7A20F8FD06
2587+
33: 3B0C18B126C1734F
2588+
34: 9CD0A5DA38FB3FE6
2589+
35: EBD38074D2039A4F
2590+
36: 12F8007B2B2552BF
2591+
37: E3A8D7EB6F20CD15
2592+
38: 48AAEC5AE87A7AB6
2593+
39: 05DF67BD335B67D3
2594+
40: 8ECF370F9B397A6D
2595+
41: E771760027A021EC
2596+
42: 8B16418D1D18EBED
2597+
43: 252904E3E9A91E88
2598+
44: D7C870C14BEB0DAF
2599+
45: 8C70C0A5786A3999
2600+
46: 579D639AEBE8F8DF
2601+
47: 0CA3D87B954DC6DF
2602+
48: 3A24AD0D9A6C22B7
2603+
49: D38FB50ACB2958CD
2604+
2605+

notes/eax_tv.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,3 +621,22 @@ EAX-serpent (16 byte key)
621621
31: EFD3F06A589F09A08D00A70F2235D64E54ED7E213F4D39191586087AC20833, 9035327451DBC7F9E9A49FF83B704C97
622622
32: 1DFDE8719F4FC7C235A1BB9862E1E6E132EC0C77EFEC71FD7E48C6B000C14291, 0CD8517E1B79FCA166F9D7CA1FB6336F
623623

624+
EAX-tea (16 byte key)
625+
0: , 581EF8A02372869F
626+
1: FB, FB90C7378F6DBE3C
627+
2: EC00, A19AB4ED51B2F2D5
628+
3: 551BF7, 73E49811E90FDEC0
629+
4: F9EA225A, CE609251E8693701
630+
5: CDD0AEFEB0, 14E611D307EA66FD
631+
6: 71C2847F58B5, 5CDF647518362E7B
632+
7: 42409A216C573F, DE90E9CBF340587C
633+
8: 4E66670E50D12994, A9C361739623DA73
634+
9: 30208A8AABA72C07C5, B85CCFACD565CAC9
635+
10: EB24F57D350908B19AA1, A2BB5B52ADDCCD5D
636+
11: A30D1E71047FA930BB4FFB, 9F6088572C52A66F
637+
12: 9BCEFFABDC81E5003A05CD43, 4DA2ACF4FB189F52
638+
13: F3ADF893A855DA761BEA526AB4, 5FEE2D491403361D
639+
14: DB8E2662E8339B64D92B849E7DFB, 2EB5E802E63D80B7
640+
15: 5E0EF25BF8AB11A0D8E8E4C68BFFFA, 4B3E3136466D7B83
641+
16: A2B4256701C9E3AFF612B0E9614C510E, 1EB5503868796FDF
642+

notes/ocb_tv.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,3 +621,22 @@ OCB-serpent (16 byte key)
621621
31: 77E2B65956B52BD90E90081F389BBFC8D4550FBCC74B6469C5CE98FC093A0F, C43272FD03A35AE4D9AF467CD7811F1D
622622
32: 77E116BE37F8153D717F3F19DEFD045C2E8CAC499295B9EE6A95A3509D4CBC47, A0406E2C09C510AB5A9E5A5B20B0C306
623623

624+
OCB-tea (16 byte key)
625+
0: , E1389796E71A9964
626+
1: 52, 9AD765743EEF7E6C
627+
2: 8FB4, C3AD7B2AA8BF6FDB
628+
3: 4998DB, 3BB882FD3008226A
629+
4: 5EAE4FBC, 09B37C919FD239CA
630+
5: A7C3303005, 3F617FD1CC528C81
631+
6: 3A325C2AC305, E2AC383FC0F167EF
632+
7: E392792697A39C, 215D2FFF2921BEAC
633+
8: 4E202347147693D7, B716880A27AF4DA4
634+
9: DCA7B8360C9AC81FFB, 0BC016ADCF52508F
635+
10: 695967EBF5FCF3517499, 6C24E93417356D9B
636+
11: 248C5246F4C1DD0586BE74, 5ED892B4576C3028
637+
12: DEBAE87E44D2121D127837E8, 50146ACA34F44650
638+
13: 7C3DF8DEA0130C0C531E41C20A, E5CAB16B8EE6FD91
639+
14: F3E1FF2655AC34ED9E455788CBCB, 3EAF740FDC652506
640+
15: FA19BF16C8F2AEDA0608C3F9833352, 92380ECC4F20FA1A
641+
16: 469E76EEBAB8C2A1DC0AD4DD53584D0F, BDB10B835DF8623A
642+

notes/omac_tv.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,3 +621,22 @@ OMAC-serpent (16 byte key)
621621
31: C7E18CC108DF3FF1E3A024A1B0B928E0
622622
32: 6E458187EC664A776005EA140154ACBF
623623

624+
OMAC-tea (16 byte key)
625+
0: 60897729F54131CF
626+
1: 3E1CAB200AA5552F
627+
2: 47A0EAF7FFE01BB0
628+
3: 1447F1EC98212470
629+
4: A58559E0BF9F9445
630+
5: 3099C9A028D58D12
631+
6: E5ADDD59BFD0495F
632+
7: 3EA329EE687F8A25
633+
8: 149685934D9CCAD1
634+
9: 3130967CE43B22D5
635+
10: 2842C1C36B15E6DC
636+
11: 59A2E900143BE9C3
637+
12: 1211C81F2888AD0C
638+
13: 45DDA7DED8403233
639+
14: 2694A22BDEC4E7E5
640+
15: A3227929FA1CBBC7
641+
16: 59638CE1C63C7776
642+

0 commit comments

Comments
 (0)